Tested a local windows build with this with various nasty questions
("--show-gateway 127.0.0.1", ON_LINK and not, etc) and v5 now gets us
the expected results for all my and Lev's tests.  Plus, the code is much
more efficient on a system with many routes than "get all the tables
from Windows, and walk through them ourselves" - just ask Windows.

The patch looks a bit larger because it reuses the IPv6 logic, extracting
the common parts into get_best_route().

Your patch has been applied to the master branch.

commit 1f6b6b5b589bfb519b09b1b4e99086d64a2c8fc4
Author: Lev Stipakov
Date:   Fri Jan 31 16:41:35 2025 +0100

     route.c: improve get_default_gateway() logic on Windows

     Signed-off-by: Lev Stipakov <l...@openvpn.net>
     Acked-by: Gert Doering <g...@greenie.muc.de>
     Message-Id: <20250131154135.32169-1-g...@greenie.muc.de>
     URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30769.html
     Signed-off-by: Gert Doering <g...@greenie.muc.de>


--
kind regards,

Gert Doering



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to