summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-15 19:47:39 +0000
committerErmal <eri@pfsense.org>2010-09-15 19:47:39 +0000
commit04c528e72b89123b129f343db8195213743d238e (patch)
treee0020c73b1268334630d377a89bd561735b37272
parent0c452870cdc2816749f4b1c12370a3d6a64158d5 (diff)
downloadpfsense-04c528e72b89123b129f343db8195213743d238e.zip
pfsense-04c528e72b89123b129f343db8195213743d238e.tar.gz
Ticket #876. Actually the event to send is interface newip $ip rather interface configure! also use the fact that now we have a /tmp/$if_defaultgw rather than relying in route get default which might block.
-rwxr-xr-xsbin/dhclient-script14
-rwxr-xr-xusr/local/sbin/ovpn-linkup2
-rwxr-xr-xusr/local/sbin/ppp-linkdown3
-rwxr-xr-xusr/local/sbin/ppp-linkup2
4 files changed, 9 insertions, 12 deletions
diff --git a/sbin/dhclient-script b/sbin/dhclient-script
index 87f8d20..6ea4136 100755
--- a/sbin/dhclient-script
+++ b/sbin/dhclient-script
@@ -82,7 +82,7 @@ add_new_address() {
echo $new_routers > /tmp/${interface}_router
echo $new_ip_address > /var/db/${interface}_ip
- /usr/local/sbin/pfSctl -c "interface reload $interface"
+ /usr/local/sbin/pfSctl -c "interface newip $interface"
}
@@ -103,15 +103,11 @@ add_new_alias() {
delete_old_routes() {
$LOGGER "Deleting old routes"
- $ROUTE delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1
# Only allow the default route to be overridden if it's on our own interface
- DEFAULTROUTE_IFACE=`/sbin/route get default | grep interface | awk '{print $2};'`
- if [ -z "${DEFAULTROUTE_IFACE}" -o "{$interface}" = "${DEFAULTROUTE_IFACE}" ]; then
+ if [ -f "/tmp/${interface}_defaultgw" ]; then
for router in $old_routers; do
- if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then
- $ROUTE delete default $route >/dev/null 2>&1
- /bin/rm -f /tmp/${interface}_router
- fi
+ $ROUTE delete default $router >/dev/null 2>&1
+ /bin/rm -f /tmp/${interface}_router
done
fi
@@ -183,8 +179,6 @@ add_new_resolv_conf() {
/usr/local/sbin/pfSctl -c 'service reload dns'
fi
- /usr/local/sbin/pfSctl -c "interface reload $interface"
-
return 0
}
diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup
index cc09003..2d5d006 100755
--- a/usr/local/sbin/ovpn-linkup
+++ b/usr/local/sbin/ovpn-linkup
@@ -3,7 +3,7 @@
# write nameservers to file needs dns fidnings?!
# let the configuration system know that the ip has changed.
-#/usr/local/sbin/pfSctl -c "interface reload $interface"
+#/usr/local/sbin/pfSctl -c "interface newip $interface"
/bin/echo $4 > /tmp/$1_router
/usr/bin/touch /tmp/$1up
# reload filter
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index 55be9d6..4d4db42 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -3,6 +3,9 @@ if [ -f /tmp/$1up ] && [ -f /conf/$1.log ]; then
seconds=$((`date -j +%s` - `/usr/bin/stat -f %m /tmp/$1up`))
/usr/local/sbin/ppp-log-uptime.sh $seconds $1 &
fi
+if [ -f "/tmp/${interface}_defaultgw" ]; then
+ route delete default $4
+fi
/sbin/pfctl -b $3 -b $4
# 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 e0b44af..dd156c4 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -18,5 +18,5 @@ fi
/bin/echo $3 > /tmp/$1_ip
/usr/bin/touch /tmp/$1up
/usr/local/sbin/pfSctl -c 'service reload dns'
-/usr/local/sbin/pfSctl -c "interface reload $1"
+/usr/local/sbin/pfSctl -c "interface newip $1"
exit 0
OpenPOWER on IntegriCloud