bin/98577: [request] dhclient(8): the link check by dhclient
slows down booting on a laptop
Nick Hibma
nick at anywi.com
Wed Oct 29 18:10:03 UTC 2008
The following reply was made to PR bin/98577; it has been noted by GNATS.
From: Nick Hibma <nick at anywi.com>
To: bug-followup at 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);
More information about the freebsd-bugs
mailing list