From 3885f8bbc4ae03fd6da0ada6de12f7223a59595c Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Fri, 25 Sep 2020 16:14:02 +0000 Subject: [PATCH] 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 --- vpnc-script | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() { -- 2.50.1