diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-06-14 20:02:24 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-06-14 20:02:24 +0000 |
commit | 7cfd039971996f8880ff1c3edfe414e678aeaed7 (patch) | |
tree | 4ec7111d2a9a587b748a3e757a70680458b1137c | |
parent | f39a67a2b1eff625a0da49790a56f4010d8e5b1a (diff) | |
download | anaconda-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)
-rw-r--r-- | loader2/loader.c | 4 | ||||
-rw-r--r-- | loader2/net.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/loader2/loader.c b/loader2/loader.c index 25f8a86d2..d879cb432 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -98,6 +98,8 @@ static int newtRunning = 0; #include "urlinstall.h" #endif +int num_link_checks = 5; + static struct installMethod installMethods[] = { #if !defined(__s390__) && !defined(__s390x__) { N_("Local CDROM"), "cdrom", 0, CLASS_CDROM, mountCdromImage }, @@ -566,6 +568,8 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData, loaderData->dns = strdup(argv[i] + 4); else if (!strncasecmp(argv[i], "ethtool=", 8)) loaderData->ethtool = strdup(argv[i] + 8); + else if (!strncasecmp(argv[i], "linksleep=", 10)) + num_link_checks = atoi(argv[i] + 10); else if (!strncasecmp(argv[i], "allowcddma", 10)) flags |= LOADER_FLAGS_ENABLECDDMA; else if (!strncasecmp(argv[i], "selinux=0", 9)) 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; } |