diff --git a/netroute_bsd.go b/netroute_bsd.go index 061dc9a..85304d9 100644 --- a/netroute_bsd.go +++ b/netroute_bsd.go @@ -9,7 +9,7 @@ // This is a BSD import for the routing structure initially found in // https://github.com/google/gopacket/blob/master/routing/routing.go -//RIB parsing follows the BSD route format described in +// RIB parsing follows the BSD route format described in // https://github.com/freebsd/freebsd/blob/master/sys/net/route.h package netroute @@ -67,6 +67,8 @@ func New() (routing.Router, error) { var ipn *net.IPNet for _, msg := range msgs { m := msg.(*route.RouteMessage) + // We ignore the error (m.Err) here. It's not clear what this error actually means, + // and it makes us miss routes that _should_ be included. routeInfo := new(rtInfo) if m.Version < 3 || m.Version > 5 { @@ -80,9 +82,6 @@ func New() (routing.Router, error) { m.Flags&(RTF_REJECT|RTF_BLACKHOLE) != 0 { continue } - if m.Err != nil { - continue - } dst, err := toIPAddr(m.Addrs[0]) if err == nil {