Skip to content

Commit

Permalink
Tune up a bit dhclient-script and call the kill state command only on…
Browse files Browse the repository at this point in the history
…ce its enough
  • Loading branch information
Ermal committed Mar 7, 2013
1 parent eff8ea7 commit 1befdbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion sbin/dhclient-script
Original file line number Diff line number Diff line change
Expand Up @@ -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}')"
Expand Down

0 comments on commit 1befdbf

Please sign in to comment.