From 1befdbf866c99106b7cd647c6e2f03defe447085 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 7 Mar 2013 10:03:09 +0000 Subject: [PATCH] Tune up a bit dhclient-script and call the kill state command only once its enough --- etc/inc/interfaces.inc | 2 +- sbin/dhclient-script | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 165b17d2b94..17bc9952a73 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1240,7 +1240,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = // log_error("Checking for old router states: {$g['tmp_path']}/{$realif}_router = {$old_router}"); if (!empty($old_router)) { log_error("Clearing states to old gateway {$old_router}."); - mwexec("/sbin/pfctl -i {$realif} -Fs; /sbin/pfctl -i {$realif} -Fs -G {$old_router}"); + mwexec("/sbin/pfctl -i {$realif} -Fs -G {$old_router}"); } /* remove interface up file if it exists */ diff --git a/sbin/dhclient-script b/sbin/dhclient-script index 814d1b9c338..26b13defe40 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -77,7 +77,7 @@ delete_old_states() { if [ -z "${OLD_ROUTER}" ] && [ -f /tmp/${interface}_router ]; then OLD_ROUTER = `cat /tmp/${interface}_router` fi - if [ -n $OLD_ROUTER ]; then + if [ -n "${OLD_ROUTER}" ]; then $LOGGER "Comparing Routers: Old: ${OLD_ROUTER} New: ${new_routers}" if [ "${OLD_ROUTER}" != "${new_routers}" ]; then $LOGGER "Removing states through old gateway '${OLD_ROUTER}' (new gateway '${new_routers}')"