summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-06-08 18:46:56 +0700
committergnhb <gnoahb@gmail.com>2010-06-08 18:46:56 +0700
commit743994a651e76254f2f079e896efd5cf5f3a29b3 (patch)
treed47cbdf88ee5277a004bbf9ae97e9746b02a0f9c
parentb20f736344a3e68c0b89b773df0ce2b9c9476757 (diff)
downloadpfsense-743994a651e76254f2f079e896efd5cf5f3a29b3.zip
pfsense-743994a651e76254f2f079e896efd5cf5f3a29b3.tar.gz
Give more time for getting dhcp address and DNS lookup.
-rw-r--r--etc/inc/interfaces.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 6b75e7e..331b101 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -923,9 +923,9 @@ function interface_ppps_configure($interface) {
// configure DHCP on the $port interface
interface_dhcp_configure($port);
// Wait for the IP address before proceeding.
- for ($count = 0; $count < 15; $count++) {
+ for ($count = 0; $count < 30; $count++) {
$localips[$pid] = find_interface_ip($port);
- if(!empty($localips[$pid]))
+ if(is_ipaddr($localips[$pid]))
break;
sleep(1);
}
@@ -937,9 +937,16 @@ function interface_ppps_configure($interface) {
escapeshellarg($localips[$pid] . "/" . $subnets[$pid]) . " up");
}
/* configure the gateway (remote IP ) */
- if (!empty($gateways[$pid]) && is_hostname($gateways[$pid]) && !is_ipaddr($gateways[$pid])) {
+ if (!is_ipaddr($gateways[$pid]) && is_hostname($gateways[$pid])) {
// do a DNS lookup for the gateway IP and store it in $gateways[$pid]
- $gateways[$pid] = gethostbyname($gateways[$pid]);
+ for ($count = 0; $count < 30; $count++) {
+ $gateways[$pid] = gethostbyname($gateways[$pid]);
+ if(is_ipaddr($gateways[$pid]))
+ break;
+ sleep(1);
+ }
+ log_error("Could not get a PPtP/L2tP Remote IP address for {$port} using DNS in interfaces_ppps_configure");
+ return 0;
}
if (0) // Logic for this?
log_error("Could not bring up interface {$port} for {$interface} {$ppp['type']} link in interface_ppps_configure().");
OpenPOWER on IntegriCloud