mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-24 15:48:52 +01:00
Check if route interface is a Microsoft ISATAP device (#2282)
check if the nexthop interfaces are Microsoft ISATAP devices and ignore their suffixes when comparing them
This commit is contained in:
parent
19147f518e
commit
9a6de52dd0
@ -232,14 +232,20 @@ func stateFromInt(state uint8) string {
|
||||
}
|
||||
|
||||
func compareIntf(a, b *net.Interface) int {
|
||||
if a == nil && b == nil {
|
||||
switch {
|
||||
case a == nil && b == nil:
|
||||
return 0
|
||||
}
|
||||
if a == nil {
|
||||
case a == nil:
|
||||
return -1
|
||||
}
|
||||
if b == nil {
|
||||
case b == nil:
|
||||
return 1
|
||||
}
|
||||
case isIsatapInterface(a.Name) && isIsatapInterface(b.Name):
|
||||
return 0
|
||||
default:
|
||||
return a.Index - b.Index
|
||||
}
|
||||
}
|
||||
|
||||
func isIsatapInterface(name string) bool {
|
||||
return strings.HasPrefix(strings.ToLower(name), "isatap")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user