Skip to content

Commit 14979d4

Browse files
committed
log SetIpForwardEntry errors correctly
1 parent 70e29f2 commit 14979d4

File tree

1 file changed

+4
-3
lines changed
  • programs/ziti-edge-tunnel/netif_driver/windows

1 file changed

+4
-3
lines changed

programs/ziti-edge-tunnel/netif_driver/windows/tun.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,13 @@ static void WINAPI if_change_cb(PVOID CallerContext, PMIB_IPINTERFACE_ROW Row, M
492492
route->NextHop = default_rt.NextHop;
493493
route->InterfaceIndex = default_rt.InterfaceIndex;
494494
route->InterfaceLuid = default_rt.InterfaceLuid;
495-
if (SetIpForwardEntry2(route) != NO_ERROR) {
495+
DWORD rc = SetIpForwardEntry2(route);
496+
if (rc != NO_ERROR) {
496497
char err[256];
497-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
498+
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, rc,
498499
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
499500
err, sizeof(err), NULL);
500-
ZITI_LOG(WARN, "failed to update route[%s]: %s", dest, err);
501+
ZITI_LOG(WARN, "failed to update route[%s]: %lu(%s)", dest, rc, err);
501502
}
502503
}
503504
}

0 commit comments

Comments
 (0)