Skip to content

Commit ccbb9e9

Browse files
committed
Netif (Windows): fix default route detection when the default adapter is disabled
This commit addresses an issue where the default route detection on Windows incorrectly identified a disabled adapter as the default route. Previously, when a user disabled the adapter configured as the default route, the system still reported it as active due to stale routing table entries.
1 parent d07fe99 commit ccbb9e9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/common/netif/netif_windows.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ bool ffNetifGetDefaultRouteImpl(FF_MAYBE_UNUSED char iface[IF_NAMESIZE + 1], uin
1818
{
1919
MIB_IPFORWARD_ROW2* row = &pIpForwardTable->Table[i];
2020

21+
if (row->Age > row->ValidLifetime) continue;
22+
2123
if ((row->DestinationPrefix.PrefixLength == 0) &&
2224
((row->DestinationPrefix.Prefix.Ipv4.sin_family == AF_INET &&
2325
row->DestinationPrefix.Prefix.Ipv4.sin_addr.S_un.S_addr == 0) ||

0 commit comments

Comments
 (0)