mirror of
https://github.com/netbirdio/go-netroute.git
synced 2026-05-22 17:11:07 -07:00
Use lower prio for bridge interfaces when doing route lookups
This commit is contained in:
@@ -102,6 +102,12 @@ func New() (routing.Router, error) {
|
||||
routeInfo.Gateway = gw
|
||||
}
|
||||
}
|
||||
|
||||
if m.Flags&syscall.RTF_WASCLONED != 0 {
|
||||
routeInfo.Priority = 99
|
||||
} else {
|
||||
routeInfo.Priority = 100
|
||||
}
|
||||
if src, err := toIPAddr(m.Addrs[5]); err == nil {
|
||||
ipn = &net.IPNet{IP: src, Mask: net.CIDRMask(8*len(src), 8*len(src))}
|
||||
routeInfo.Src = ipn
|
||||
|
||||
Reference in New Issue
Block a user