Date: Wed, 29 Oct 2008 18:10:03 GMT From: Nick Hibma <nick@anywi.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/98577: [request] dhclient(8): the link check by dhclient slows down booting on a laptop Message-ID: <200810291810.m9TIA3Tt009832@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/98577; it has been noted by GNATS.
From: Nick Hibma <nick@anywi.com>
To: bug-followup@freebsd.org
Cc:
Subject: Re: bin/98577: [request] dhclient(8): the link check by dhclient slows down booting on a laptop
Date: Wed, 29 Oct 2008 19:00:46 +0100
I actually did a patch quite some time ago. Below a block of code is simply
moved from one spot to another.
Index: dhclient.c
===================================================================
--- dhclient.c (revision 184060)
+++ dhclient.c (working copy)
@@ -371,22 +371,6 @@
read_client_conf();
- if (!interface_link_status(ifi->name)) {
- fprintf(stderr, "%s: no link ...", ifi->name);
- fflush(stderr);
- sleep(1);
- while (!interface_link_status(ifi->name)) {
- fprintf(stderr, ".");
- fflush(stderr);
- if (++i > 10) {
- fprintf(stderr, " giving up\n");
- exit(1);
- }
- sleep(1);
- }
- fprintf(stderr, " got link\n");
- }
-
if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
error("cannot open %s: %m", _PATH_DEVNULL);
@@ -438,6 +422,22 @@
if (immediate_daemon)
go_daemon();
+ if (!interface_link_status(ifi->name)) {
+ fprintf(stderr, "%s: no link ...", ifi->name);
+ fflush(stderr);
+ sleep(1);
+ while (!interface_link_status(ifi->name)) {
+ fprintf(stderr, ".");
+ fflush(stderr);
+ if (++i > 10) {
+ fprintf(stderr, " giving up\n");
+ exit(1);
+ }
+ sleep(1);
+ }
+ fprintf(stderr, " got link\n");
+ }
+
ifi->client->state = S_INIT;
state_reboot(ifi);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810291810.m9TIA3Tt009832>
