mirror of
https://github.com/netbirdio/go-netroute.git
synced 2026-05-22 17:11:07 -07:00
ignore the error on the RouteMessage on Darwin
This commit is contained in:
+3
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user