Revision b448e2cb
Added by Chris Buechler over 17 years ago
etc/inc/interfaces.inc | ||
---|---|---|
781 | 781 |
} |
782 | 782 |
|
783 | 783 |
function interfaces_wan_configure() { |
784 |
|
|
785 |
require_once("Timer.php"); |
|
786 |
$timer = new Benchmark_Timer; |
|
787 |
|
|
788 |
$timer->start(); |
|
789 |
|
|
784 | 790 |
global $config, $g, $bridges_total; |
785 | 791 |
|
786 | 792 |
$wancfg = $config['interfaces']['wan']; |
787 | 793 |
|
794 |
$timer->setMarker('marker1'); |
|
795 |
|
|
788 | 796 |
if(!$g['booting']) { |
789 | 797 |
mute_kernel_msgs(); |
790 | 798 |
|
... | ... | |
793 | 801 |
|
794 | 802 |
/* remove wanup file if it exists */ |
795 | 803 |
unlink_if_exists("{$g['tmp_path']}/wanup"); |
804 |
$timer->setMarker('marker2'); |
|
796 | 805 |
|
797 | 806 |
/* kill PPPoE client (mpd) */ |
798 | 807 |
killbypid("{$g['varrun_path']}/mpd.pid"); |
799 | 808 |
|
800 | 809 |
/* wait for processes to die */ |
801 | 810 |
sleep(3); |
802 |
|
|
811 |
$timer->setMarker('marker3'); |
|
803 | 812 |
unlink_if_exists("{$g['varetc_path']}/dhclient_wan.conf"); |
804 | 813 |
unlink_if_exists("{$g['varetc_path']}/mpd.conf"); |
805 | 814 |
unlink_if_exists("{$g['varetc_path']}/mpd.links"); |
... | ... | |
811 | 820 |
while (mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " -alias") == 0); |
812 | 821 |
mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " down"); |
813 | 822 |
|
823 |
$timer->setMarker('marker4'); |
|
824 |
|
|
814 | 825 |
/* wireless configuration? */ |
815 | 826 |
if (is_array($wancfg['wireless'])) |
816 | 827 |
interfaces_wireless_configure($wancfg['if'], $wancfg['wireless']); |
... | ... | |
834 | 845 |
} |
835 | 846 |
} |
836 | 847 |
|
848 |
$timer->setMarker('marker5'); |
|
849 |
|
|
837 | 850 |
/* media */ |
838 | 851 |
if ($wancfg['media'] || $wancfg['mediaopt']) { |
839 | 852 |
$cmd = "/sbin/ifconfig " . escapeshellarg($wancfg['if']); |
... | ... | |
1089 | 1102 |
$dhclientconf = ""; |
1090 | 1103 |
|
1091 | 1104 |
$dhclientconf .= <<<EOD |
1092 |
timeout 1200;
|
|
1105 |
timeout 60;
|
|
1093 | 1106 |
retry 1; |
1094 | 1107 |
select-timeout 0; |
1095 | 1108 |
initial-interval 1; |
Also available in: Unified diff
Revert dhclient timeout to the default of 60 seconds. Setting it to 20 minutes
is a bit insane (if you haven't gotten a reply in 60 seconds, you aren't
getting one), and causes systems to hang 20 minutes during
"Configuring WAN" at boot when there is no DHCP server available
on the WAN interface.