Skip to content

Commit

Permalink
[client] Don't choke on non-existent interface in route updates (#2922)
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal authored Dec 3, 2024
1 parent 17c20b4 commit 8866394
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion client/firewall/nftables/state.go

This file was deleted.

9 changes: 6 additions & 3 deletions client/internal/routemanager/systemops/systemops_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8866394

Please sign in to comment.