Use lower prio for bridge interfaces when doing route lookups

This commit is contained in:
Viktor Liu
2024-06-10 18:42:38 +09:00
parent 37ae739e79
commit 757f41cb28
+6
View File
@@ -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