]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
Ignore link-local routes in set_default_route
authorDaniel Lenski <dlenski@gmail.com>
Fri, 25 Sep 2020 16:14:02 +0000 (16:14 +0000)
committerDaniel Lenski <dlenski@gmail.com>
Fri, 25 Sep 2020 16:14:02 +0000 (16:14 +0000)
See https://gitlab.com/openconnect/openconnect/-/issues/180#note_418673102, and https://superuser.com/a/1067742 for an explanation of what these routes mean on macOS.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
vpnc-script

index ac67c371bb256a4bbd5bf3b17f72d660f26a10d1..24788fef5e7b8545a9f58d9843ca9f340bc9d634 100755 (executable)
@@ -361,7 +361,8 @@ else # use route command
                # isn't -n supposed to give --numeric output?
                # apperently not...
                # Get rid of lines containing IPv6 addresses (':')
-               netstat -r -n | awk '/:/ { next; } /^(default|0\.0\.0\.0)/ { print $2; }'
+               # Get rid of lines for link-local routes (https://superuser.com/a/1067742)
+               netstat -r -n | awk '/:/ { next; } /link\#/ { next; } /^(default|0\.0\.0\.0)/ { print $2; }'
        }
 
        set_vpngateway_route() {