summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2016-02-14 00:28:29 -0500
committerjim-p <jimp@pfsense.org>2016-02-14 00:28:29 -0500
commit2efb39d092a971c6ea8d06b25c315be7d400c4a1 (patch)
treef09467e90a4063d3dabcdcb065bc52e58be2b0cb /src/usr
parent6a5fc3d7108e30f5a6867fe730804fe3064931d8 (diff)
downloadpfsense-2efb39d092a971c6ea8d06b25c315be7d400c4a1.zip
pfsense-2efb39d092a971c6ea8d06b25c315be7d400c4a1.tar.gz
Make a couple changes to PPP default gateway handling to address issues with default gateway switching. Fixes #1837
Tested with default gateway switching on and off, by rebooting, manually disconnecting the PPP link, and manually disconnecting the NIC link, worked each time, though still possible some issues remain. Feedback appreciated.
Diffstat (limited to 'src/usr')
-rwxr-xr-xsrc/usr/local/sbin/ppp-linkdown8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/usr/local/sbin/ppp-linkdown b/src/usr/local/sbin/ppp-linkdown
index 6fca066..3faf5f1 100755
--- a/src/usr/local/sbin/ppp-linkdown
+++ b/src/usr/local/sbin/ppp-linkdown
@@ -13,9 +13,13 @@ fi
if [ "${PROTOCOL}" == "inet" && -s "/tmp/${IF}_defaultgw" ]; then
GW=`head -n 1 /tmp/${IF}_defaultgw`
- [ -n "${GW}" ] \
- && /sbin/route -q delete default ${GW}
+ DGW=`/sbin/route -n get -inet default | /usr/bin/awk '/gateway:/ {print $2}'`
+ # Only remove the default gateway if it matches the gateway for this interface. See redmine #1837
+ if [ "${GW}" = "${DGW}" ]; then
+ /sbin/route -q delete default ${GW}
+ fi
fi
+
if [ "${PROTOCOL}" == "inet6" ]; then
/usr/local/sbin/ppp-ipv6 ${IF} down
fi
OpenPOWER on IntegriCloud