From: Daniel Lenski Date: Fri, 25 Sep 2020 16:14:02 +0000 (+0000) Subject: Ignore link-local routes in set_default_route X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3885f8bbc4ae03fd6da0ada6de12f7223a59595c;p=users%2Fdwmw2%2Fvpnc-scripts.git Ignore link-local routes in set_default_route 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 --- diff --git a/vpnc-script b/vpnc-script index ac67c37..24788fe 100755 --- a/vpnc-script +++ b/vpnc-script @@ -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() {