mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-09 11:52:00 -04:00
On Windows, we used to create all routes using the interface IP address as the next hop. Notably, on Windows 8 and later, the system normalizes that next hop to 0.0.0.0, resulting in an on-link route. In #12847, we stopped creating on-link subnet routes because doing so made the last IP address in the range unreachable. However, we missed a related issue. As a result, we continued specifying the interface IP address as the next hop for Tailscale IP routes. Because Windows normalizes those routes to use an unspecified next hop, the routes we read back from the system did not match the routes we expected to see. This caused unnecessary churn, with the same routes being repeatedly deleted and recreated. In this PR, we start creating on-link routes with a normalized, unspecified (all-zeroes) next hop, as required by the API. This ensures that the routes we read back match the desired routes, preventing unnecessary churn. https://web.archive.org/web/20260924154040/https://learn.microsoft.com/en-us/windows-hardware/drivers/network/mib-ipforward-row2 Fixes #21438 Reported-by: Caleb Crome <caleb.crome@flyzipline.com> Signed-off-by: Nick Khyl <nickk@tailscale.com>