mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 17:58:02 +02:00
[client] Don't choke on non-existent interface in route updates (#2922)
This commit is contained in:
parent
17c20b45ce
commit
8866394eb6
@ -1 +0,0 @@
|
|||||||
package nftables
|
|
@ -230,11 +230,14 @@ func (rm *RouteMonitor) parseUpdate(row *MIB_IPFORWARD_ROW2, notificationType MI
|
|||||||
if idx != 0 {
|
if idx != 0 {
|
||||||
intf, err := net.InterfaceByIndex(idx)
|
intf, err := net.InterfaceByIndex(idx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return update, fmt.Errorf("get interface name: %w", err)
|
log.Warnf("failed to get interface name for index %d: %v", idx, err)
|
||||||
|
update.Interface = &net.Interface{
|
||||||
|
Index: idx,
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
update.Interface = intf
|
update.Interface = intf
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Tracef("Received route update with destination %v, next hop %v, interface %v", row.DestinationPrefix, row.NextHop, update.Interface)
|
log.Tracef("Received route update with destination %v, next hop %v, interface %v", row.DestinationPrefix, row.NextHop, update.Interface)
|
||||||
dest := parseIPPrefix(row.DestinationPrefix, idx)
|
dest := parseIPPrefix(row.DestinationPrefix, idx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user