mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-12 08:58:44 +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 {
|
func compareIntf(a, b *net.Interface) int {
|
||||||
if a == nil && b == nil {
|
switch {
|
||||||
|
case a == nil && b == nil:
|
||||||
return 0
|
return 0
|
||||||
}
|
case a == nil:
|
||||||
if a == nil {
|
|
||||||
return -1
|
return -1
|
||||||
}
|
case b == nil:
|
||||||
if b == nil {
|
|
||||||
return 1
|
return 1
|
||||||
}
|
case isIsatapInterface(a.Name) && isIsatapInterface(b.Name):
|
||||||
|
return 0
|
||||||
|
default:
|
||||||
return a.Index - b.Index
|
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