remove full iface access assumption

linux/bsd
fix #8
parent bca610e7
......@@ -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()
......
......@@ -12,7 +12,6 @@
package netroute
import (
"fmt"
"net"
"sort"
"syscall"
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment