summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-03-19 11:15:37 +0000
committerErmal <eri@pfsense.org>2013-03-19 11:15:37 +0000
commitdeb39cf2be25ccccce41f9a19954bf0c6d7cedb3 (patch)
tree8da63e9e049a054953002e584123380cd0a20e30 /etc
parentbd66cf325a63ada84a17c1462a21ca028e8d7379 (diff)
downloadpfsense-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')
-rw-r--r--etc/inc/interfaces.inc8
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");
OpenPOWER on IntegriCloud