diff options
author | Ermal <eri@pfsense.org> | 2013-03-19 11:15:37 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-03-19 11:15:37 +0000 |
commit | deb39cf2be25ccccce41f9a19954bf0c6d7cedb3 (patch) | |
tree | 8da63e9e049a054953002e584123380cd0a20e30 /etc/inc/interfaces.inc | |
parent | bd66cf325a63ada84a17c1462a21ca028e8d7379 (diff) | |
download | pfsense-deb39cf2be25ccccce41f9a19954bf0c6d7cedb3.zip pfsense-deb39cf2be25ccccce41f9a19954bf0c6d7cedb3.tar.gz |
When reconfiguring interfaces with dhcp types set try to kill any previous dhcp process of the interface already running
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index afa9e65..381fe06 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1173,7 +1173,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = case "dhcp": $pid = find_dhclient_process($realif); if($pid) - mwexec("/bin/kill {$pid}"); + posix_kill($pid, SIGTERM); sleep(1); unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf"); if(does_interface_exist("$realif")) { @@ -3546,6 +3546,9 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) { if (!$g['booting']) filter_configure_sync(false); + $pidv6 = find_dhcp6c_process($wanif); + if ($pidv6) + posix_kill($pidv6, SIGTERM); /* fire up dhcp6c for IPv6 first, this backgrounds immediately */ mwexec("/usr/local/sbin/dhcp6c -d -c {$g['varetc_path']}/dhcp6c_{$interface}.conf -p {$g['varrun_path']}/dhcp6c_{$wanif}.pid {$wanif}"); sleep(1); @@ -3633,6 +3636,9 @@ EOD; else log_error(printf(gettext("Could not bring up %s interface in interface_dhcp_configure()"), $wanif)); + $pid = find_dhclient_process($wanif); + if ($pid) + posix_kill($pid, SIGTERM); /* fire up dhclient */ mwexec("/sbin/dhclient -c {$g['varetc_path']}/dhclient_{$interface}.conf {$wanif} > {$g['tmp_path']}/{$wanif}_output 2> {$g['tmp_path']}/{$wanif}_error_output"); |