mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
* 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
This commit is contained in:
parent
f1d5b72c41
commit
ca88e48ff1
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@ -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 = "") {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user