[PR #7046] fix(client): Windows dial fallback across route candidate interfaces #27900

Open
opened 2026-08-05 07:09:23 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/7046
Author: @siraykut
Created: 8/3/2026
Status: 🔄 Open

Base: mainHead: fix/windows-mgmt-dial-iface-fallback


📝 Commits (2)

  • ebb7f67 fix(client): fall back across Windows dial interfaces for management connectivity
  • 5f5e1c8 Merge branch 'main' into fix/windows-mgmt-dial-iface-fallback

📊 Changes

6 files changed (+259 additions, -8 deletions)

View changed files

📝 client/internal/routemanager/systemops/systemops_windows.go (+30 -3)
client/net/dialer_advanced.go (+12 -0)
client/net/dialer_advanced_windows.go (+142 -0)
client/net/dialer_advanced_windows_test.go (+53 -0)
📝 client/net/dialer_dial.go (+4 -1)
📝 client/net/net_windows.go (+18 -4)

📄 Description

Describe your changes

On dual-homed Windows hosts, advanced routing (IP_UNICAST_IF) can pin management/signal gRPC dials to a metric-preferred NIC that has a default route but no working upstream. The dial then times out and never tries another interface that can reach the management server.

This change:

  • Adds GetCandidateInterfaces (all usable interfaces, best-first)
  • Retries Windows advanced-routing dials across candidates with a split timeout budget
  • Logs when a fallback interface succeeds

https://github.com/netbirdio/netbird/discussions/7045

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactoring
  • Added unit tests for timeout splitting / interface selection helpers

Documentation

  • Not needed

Summary by CodeRabbit

  • New Features
    • Improved Windows network routing by selecting and trying multiple suitable interfaces.
    • Added interface-aware IPv4 and IPv6 connection attempts.
    • Added support for resolving destinations before selecting connection interfaces.
    • Preserved fallback behavior when advanced routing is unavailable.
  • Bug Fixes
    • Improved handling of unavailable, loopback, inactive, excluded, and duplicate interfaces.
    • Preserved connection timeouts, cancellation, and error reporting.
  • Tests
    • Added coverage for timeout handling, deadlines, and IP version interface selection.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/7046 **Author:** [@siraykut](https://github.com/siraykut) **Created:** 8/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-mgmt-dial-iface-fallback` --- ### 📝 Commits (2) - [`ebb7f67`](https://github.com/netbirdio/netbird/commit/ebb7f6729f4943e15bfe5a3000743847aefc9b21) fix(client): fall back across Windows dial interfaces for management connectivity - [`5f5e1c8`](https://github.com/netbirdio/netbird/commit/5f5e1c86e6ef6048953b85766ef97e1ecd1cced0) Merge branch 'main' into fix/windows-mgmt-dial-iface-fallback ### 📊 Changes **6 files changed** (+259 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/routemanager/systemops/systemops_windows.go` (+30 -3) ➕ `client/net/dialer_advanced.go` (+12 -0) ➕ `client/net/dialer_advanced_windows.go` (+142 -0) ➕ `client/net/dialer_advanced_windows_test.go` (+53 -0) 📝 `client/net/dialer_dial.go` (+4 -1) 📝 `client/net/net_windows.go` (+18 -4) </details> ### 📄 Description ## Describe your changes On dual-homed Windows hosts, advanced routing (`IP_UNICAST_IF`) can pin management/signal gRPC dials to a metric-preferred NIC that has a default route but no working upstream. The dial then times out and never tries another interface that can reach the management server. This change: - Adds `GetCandidateInterfaces` (all usable interfaces, best-first) - Retries Windows advanced-routing dials across candidates with a split timeout budget - Logs when a fallback interface succeeds ## Issue ticket number and link https://github.com/netbirdio/netbird/discussions/7045 ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactoring - [x] Added unit tests for timeout splitting / interface selection helpers ## Documentation - [x] Not needed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved Windows network routing by selecting and trying multiple suitable interfaces. * Added interface-aware IPv4 and IPv6 connection attempts. * Added support for resolving destinations before selecting connection interfaces. * Preserved fallback behavior when advanced routing is unavailable. * **Bug Fixes** * Improved handling of unavailable, loopback, inactive, excluded, and duplicate interfaces. * Preserved connection timeouts, cancellation, and error reporting. * **Tests** * Added coverage for timeout handling, deadlines, and IP version interface selection. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:09:23 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#27900