summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-09-26 08:48:12 -0400
committerjim-p <jimp@pfsense.org>2012-09-26 08:48:12 -0400
commit766cd4502596209a148eb114fc422e6b2245f3d9 (patch)
treeb6d7fa04d48ecfe2182036a25c3f1432a567571c /usr/local/sbin
parent80c043fa48788950eef05eafe9ec25c19457db57 (diff)
downloadpfsense-766cd4502596209a148eb114fc422e6b2245f3d9.zip
pfsense-766cd4502596209a148eb114fc422e6b2245f3d9.tar.gz
Try a little harder to clear the states for the old PPP gateway
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/ppp-linkdown11
-rwxr-xr-xusr/local/sbin/ppp-linkup7
2 files changed, 13 insertions, 5 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index bd4f606..56a96d9 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -9,14 +9,15 @@ if [ "$3" != "" ]; then
/sbin/pfctl -k $3/32
pfctl -K $3/32
fi
-if [ "$4" != "" ]; then
- echo "Removing states to $4" | logger -t ppp-linkdown
- /sbin/pfctl -b 0.0.0.0/32 -b $4/32
+
+OLD_ROUTER=`/bin/cat /tmp/${1}_router`
+if [ "${OLD_ROUTER}" != "" ]; then
+ echo "Removing states to ${OLD_ROUTER}" | logger -t ppp-linkdown
+ /sbin/pfctl -b 0.0.0.0/32 -b ${OLD_ROUTER}/32
if [ -f "/tmp/${interface}_defaultgw" ]; then
- route delete default $4
+ route delete default ${OLD_ROUTER}
fi
-
fi
# delete the node just in case mpd cannot do that
/usr/sbin/ngctl shutdown $1:
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index dba4412..3a62fbb 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -1,6 +1,13 @@
#!/bin/sh
if [ "$2" == "inet" ]; then
+
+ OLD_ROUTER=`/bin/cat /tmp/${1}_router`
+ if [ "${OLD_ROUTER}" != "" ]; then
+ echo "Removing states to old router ${OLD_ROUTER}" | logger -t ppp-linkup
+ /sbin/pfctl -b 0.0.0.0/32 -b ${OLD_ROUTER}/32
+ fi
+
# let the configuration system know that the ipv4 has changed.
/bin/echo $4 > /tmp/$1_router
/bin/echo $3 > /tmp/$1_ip
OpenPOWER on IntegriCloud