tunnel/route_windows: fix locale-dependent parsing in route commands#22981
tunnel/route_windows: fix locale-dependent parsing in route commands#22981carterpewpew wants to merge 1 commit into
Conversation
EnsureRouteIsAdded, Cleanup, and parseTable relied on English stdout
strings (" OK!\r\n" and "Network Destination") that differ on localized
Windows. Use the command exit code and net.ParseIP filtering instead.
Also re-check route existence after a failed route ADD to handle
TOCTOU races gracefully.
Signed-off-by: Jathavedhan M <jathavedhan.m@ibm.com>
|
Hi @carterpewpew. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: carterpewpew The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Can one of the admins verify this patch? |
On non-English Windows,
minikube tunnelenters an endless retry loop becauseroute_windows.gorelies on English stdout strings that differ across locales.Three call sites were affected:
EnsureRouteIsAddedcompared stdout against" OK!\r\n". On Russian locale this is Cyrillic (" ОК!\r\n"), so it errored even when the route was successfully added (exit code 0).parseTablewaited for a"Network Destination"header before parsing rows. On localized Windows the header is translated, so the routing table was always empty andInspectcould never detect existing routes.Cleanuphad the same" OK!\r\n"check.This PR replaces all three with the command exit code and uses
net.ParseIPto naturally filter non-route lines inparseTable, matching the approach already used inroute_linux.go. Also re-checks route existence after a failedroute ADDto handle TOCTOU races gracefully.Fixes #11645