Skip to content

Commit

Permalink
remove full iface access assumption
Browse files Browse the repository at this point in the history
linux/bsd
fix #8
  • Loading branch information
willscott committed Mar 31, 2020
1 parent bca610e commit ec875c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions netroute_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ func New() (routing.Router, error) {
if err != nil {
return nil, err
}
for i, iface := range ifaces {
if i != iface.Index-1 {
return nil, fmt.Errorf("out of order iface %d = %v", i, iface)
}
for _, iface := range ifaces {
rtr.ifaces = append(rtr.ifaces, iface)
var addrs ipAddrs
ifaceAddrs, err := iface.Addrs()
Expand Down
6 changes: 1 addition & 5 deletions netroute_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package netroute

import (
"fmt"
"net"
"sort"
"syscall"
Expand Down Expand Up @@ -83,10 +82,7 @@ loop:
if err != nil {
return nil, err
}
for i, iface := range ifaces {
if i != iface.Index-1 {
return nil, fmt.Errorf("out of order iface %d = %v", i, iface)
}
for _, iface := range ifaces {
rtr.ifaces = append(rtr.ifaces, iface)
var addrs ipAddrs
ifaceAddrs, err := iface.Addrs()
Expand Down

0 comments on commit ec875c9

Please sign in to comment.