summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-12-23 00:00:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-12-23 00:00:28 +0000
commitca88e48ff17d7e5e2a7d5968ae9730c92bdff724 (patch)
tree8c1b8ff6bfe2e3e0ccf59913fc36ede84a9212eb /etc/inc
parentf1d5b72c4130de3511c302e5e3fc34914a3003de (diff)
downloadpfsense-ca88e48ff17d7e5e2a7d5968ae9730c92bdff724.zip
pfsense-ca88e48ff17d7e5e2a7d5968ae9730c92bdff724.tar.gz
* Fix release / renew
* Don't return immediately from dhclient to give it time to associate so we can return correct address back to status_interfaces.php
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/interfaces.inc17
-rw-r--r--etc/inc/service-utils.inc9
2 files changed, 12 insertions, 14 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 75ccf12..9045ae5 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -742,9 +742,8 @@ function kill_wpasupplicant($interface) {
}
function find_dhclient_process($interface) {
- if(filter_translate_type_to_real_interface($interface) <> "")
- $realinterface = filter_translate_type_to_real_interface($interface);
- $pid = exec("/bin/pgrep -f \"dhclient (.*){$realinterface}\"");
+ $interface = convert_friendly_interface_to_real_interface_name($interface);
+ $pid = exec("/bin/ps awwux | /usr/bin/grep dhclient | /usr/bin/grep -v grep | /usr/bin/grep {$interface}");
return $pid;
}
@@ -965,7 +964,7 @@ EOD;
mwexec("/sbin/ifconfig {$optif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
return 0;
}
@@ -1004,10 +1003,10 @@ EOD;
mwexec("/sbin/ifconfig {$optif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif} ");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif} ");
$fout = fopen("/tmp/ifconfig_{$optif}","w");
- fwrite($fout, "/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
+ fwrite($fout, "/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
fclose($fout);
return 0;
@@ -1044,10 +1043,10 @@ EOD;
mwexec("/sbin/ifconfig {$wanif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
$fout = fopen("/tmp/ifconfig_{$wanif}","w");
- fwrite($fout, "/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
+ fwrite($fout, "/sbin/dhclient -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
fclose($fout);
return 0;
@@ -1583,4 +1582,4 @@ function get_interface_mac($interface) {
return $mac;
}
-?>
+?> \ No newline at end of file
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index d869819..01d2714 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -143,12 +143,11 @@ function is_process_running($process) {
}
function is_dhcp_running($interface) {
- if(filter_translate_type_to_real_interface($interface) <> "")
- $interface = filter_translate_type_to_real_interface($interface);
+ $interface = convert_friendly_interface_to_real_interface_name($interface);
$status = find_dhclient_process($interface);
if($status <> "")
- return 1;
- return 0;
+ return true;
+ return false;
}
function restart_service_if_running($service) {
@@ -182,4 +181,4 @@ function is_service_running($service, $ps = "") {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud