From 8866394eb6879aa94d5fbd259b64830fdca45569 Mon Sep 17 00:00:00 2001 From: Viktor Liu <17948409+lixmal@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:33:41 +0100 Subject: [PATCH] [client] Don't choke on non-existent interface in route updates (#2922) --- client/firewall/nftables/state.go | 1 - .../internal/routemanager/systemops/systemops_windows.go | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 client/firewall/nftables/state.go diff --git a/client/firewall/nftables/state.go b/client/firewall/nftables/state.go deleted file mode 100644 index 7027fe98719..00000000000 --- a/client/firewall/nftables/state.go +++ /dev/null @@ -1 +0,0 @@ -package nftables diff --git a/client/internal/routemanager/systemops/systemops_windows.go b/client/internal/routemanager/systemops/systemops_windows.go index b1732a08001..ad325e12377 100644 --- a/client/internal/routemanager/systemops/systemops_windows.go +++ b/client/internal/routemanager/systemops/systemops_windows.go @@ -230,10 +230,13 @@ func (rm *RouteMonitor) parseUpdate(row *MIB_IPFORWARD_ROW2, notificationType MI if idx != 0 { intf, err := net.InterfaceByIndex(idx) 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)