summaryrefslogtreecommitdiffstats
path: root/loader2/net.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-06-14 20:02:24 +0000
committerJeremy Katz <katzj@redhat.com>2004-06-14 20:02:24 +0000
commit7cfd039971996f8880ff1c3edfe414e678aeaed7 (patch)
tree4ec7111d2a9a587b748a3e757a70680458b1137c /loader2/net.c
parentf39a67a2b1eff625a0da49790a56f4010d8e5b1a (diff)
downloadanaconda-7cfd039971996f8880ff1c3edfe414e678aeaed7.tar.gz
anaconda-7cfd039971996f8880ff1c3edfe414e678aeaed7.tar.xz
anaconda-7cfd039971996f8880ff1c3edfe414e678aeaed7.zip
merge changes from taroon branch:
* configurable amount of time to wait for link to be available * wait for a link after bringing the interface back up with its final ip as some switches decide that they should reconfigure at that point (#115825)
Diffstat (limited to 'loader2/net.c')
-rw-r--r--loader2/net.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/loader2/net.c b/loader2/net.c
index 10f2845c2..e48a47ef1 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -119,20 +119,21 @@ static void fillInIpInfo(struct networkDeviceConfig * cfg) {
}
static int waitForLink(char * dev) {
+ extern int num_link_checks;
int tries = 0;
/* try to wait for a valid link -- if the status is unknown or
* up continue, else sleep for 1 second and try again for up
* to five times */
logMessage("waiting for link...");
- while (tries < 5) {
- if (get_link_status(dev) != 0)
+ while (tries < num_link_checks) {
+ if (get_link_status(dev) != 0)
break;
sleep(1);
tries++;
}
logMessage("%d seconds.", tries);
- if (tries < 5)
+ if (tries < num_link_checks)
return 0;
return 1;
}
@@ -651,6 +652,10 @@ int configureNetwork(struct networkDeviceConfig * dev) {
if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY)
pumpSetupDefaultGateway(&dev->dev.gateway);
+ /* we need to wait for a link after setting up the interface as some
+ * switches decide to reconfigure themselves after that (#115825)
+ */
+ waitForLink((char *)&dev->dev.device);
return 0;
}