Only do dhclient once; it has its own internal retry which is more than

long enough (and doing it multiple times results in a dialog which waits
AGES to complete).
This commit is contained in:
Jordan K. Hubbard 1999-09-06 15:06:17 +00:00
parent e5174d14c5
commit 7bd659ebaf
2 changed files with 20 additions and 16 deletions

View File

@ -225,16 +225,18 @@ tcpOpenDialog(Device *devp)
Mkdir("/var/run");
Mkdir("/tmp");
msgNotify("Scanning for DHCP servers...");
for (k = 1; k < 4; k++) {
if (0 == vsystem("dhclient -1 %s", devp->name)) {
dhcpGetInfo(devp);
use_dhcp = TRUE;
break;
}
msgNotify("Scanning for DHCP servers... Retry: %d", k);
if (0 == vsystem("dhclient -1 %s", devp->name)) {
dhcpGetInfo(devp);
use_dhcp = TRUE;
}
else
use_dhcp = FALSE;
}
/* Special hack so it doesn't show up oddly in the tcpip setup menu */
if (!strcmp(gateway, "NO"))
gateway[0] = '\0';
/* Get old IP address from variable space, if available */
if (!ipaddr[0]) {
if ((cp = variable_get(VAR_IPADDR)) != NULL)
@ -273,7 +275,7 @@ tcpOpenDialog(Device *devp)
}
if (!gateway[0]) {
tmp = variable_get(VAR_GATEWAY);
if (tmp)
if (tmp && strcmp(tmp, "NO"))
SAFE_STRCPY(gateway, tmp);
}
if (!nameserver[0]) {

View File

@ -225,16 +225,18 @@ tcpOpenDialog(Device *devp)
Mkdir("/var/run");
Mkdir("/tmp");
msgNotify("Scanning for DHCP servers...");
for (k = 1; k < 4; k++) {
if (0 == vsystem("dhclient -1 %s", devp->name)) {
dhcpGetInfo(devp);
use_dhcp = TRUE;
break;
}
msgNotify("Scanning for DHCP servers... Retry: %d", k);
if (0 == vsystem("dhclient -1 %s", devp->name)) {
dhcpGetInfo(devp);
use_dhcp = TRUE;
}
else
use_dhcp = FALSE;
}
/* Special hack so it doesn't show up oddly in the tcpip setup menu */
if (!strcmp(gateway, "NO"))
gateway[0] = '\0';
/* Get old IP address from variable space, if available */
if (!ipaddr[0]) {
if ((cp = variable_get(VAR_IPADDR)) != NULL)
@ -273,7 +275,7 @@ tcpOpenDialog(Device *devp)
}
if (!gateway[0]) {
tmp = variable_get(VAR_GATEWAY);
if (tmp)
if (tmp && strcmp(tmp, "NO"))
SAFE_STRCPY(gateway, tmp);
}
if (!nameserver[0]) {