From nobody@www.freebsd.org  Sat May 25 21:36:01 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 69E3A37B405
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 25 May 2002 21:36:01 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g4Q4a1hG036570
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 25 May 2002 21:36:01 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g4Q4a180036569;
	Sat, 25 May 2002 21:36:01 -0700 (PDT)
Message-Id: <200205260436.g4Q4a180036569@www.freebsd.org>
Date: Sat, 25 May 2002 21:36:01 -0700 (PDT)
From: "Jan L. Peterson" <jlp@softhome.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.network hangs for a long time attempting dhcp setup of disconnected interface
X-Send-Pr-Version: www-1.0

>Number:         38559
>Category:       conf
>Synopsis:       rc.network hangs for a long time attempting dhcp setup of disconnected interface
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 25 21:40:01 PDT 2002
>Closed-Date:    Thu Jan 09 09:06:59 PST 2003
>Last-Modified:  Thu Jan  9 09:50:01 PST 2003
>Originator:     Jan L. Peterson
>Release:        4.5-RELEASE
>Organization:
>Environment:
FreeBSD aurora.corp.flipdog.com 4.5-RELEASE FreeBSD 4.5-RELEASE #2: Thu May  2 13:28:39 MDT 2002     root@aurora.corp.flipdog.com:/usr/src/sys/compile/AURORA  i386
>Description:
When booting my laptop with the lan disconnected, the system hangs for a short while right after printing 
  Doing initial network setup; hostname

This happens because the interface, which has been set for DHCP, is not connected to a cable.  The system hangs until dhclient times out (or I press ctrl-C on the console :-), then proceeds with normal startup.

>How-To-Repeat:
Boot a machine configured for DHCP with the network cable unplugged.
>Fix:
I will attach a patch to the PR once it is issued.  A brief synopsis of the patch is:

In /etc/rc.network, there is a loop where it goes through all configured interfaces, looking for those set for DHCP.  When it finds one, it adds it to the dhcp_interfaces variable.  The patch first checks if there is carrier present on the interface, and if not, doesn't add it to dhcp_interfaces.
>Release-Note:
>Audit-Trail:

From: "Jan L. Peterson" <jlp@softhome.net>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: conf/38559: rc.network hangs for a long time attempting dhcp setup of disconnected interface 
Date: Sat, 25 May 2002 22:50:53 -0600

 This is a multipart MIME message.
 
 --==_Exmh_-2152329320
 Content-Type: text/plain; charset=us-ascii
 
 Here's the patch as promised.
 
 	-jan-
 
 
 
 --==_Exmh_-2152329320
 Content-Type: text/plain ; name="j1"; charset=us-ascii
 Content-Description: j1
 Content-Disposition: attachment; filename="j1"
 
 *** rc.network-orig	Sat May 25 22:32:58 2002
 --- rc.network	Fri May 17 21:52:56 2002
 ***************
 *** 203,209 ****
   			;;
   		[Dd][Hh][Cc][Pp])
   			# DHCP inits are done all in one go below
 ! 			dhcp_interfaces="$dhcp_interfaces $ifn"
   			eval showstat_$ifn=1
   			;;
   		*)
 --- 203,218 ----
   			;;
   		[Dd][Hh][Cc][Pp])
   			# DHCP inits are done all in one go below
 ! ### jlp
 ! ###
 ! ### check dhcp interfaces for signal before adding them in
 ! ###
 ! 			if ifconfig $ifn | grep status | 
 ! 			   grep -v "no carrier" >/dev/null 2>&1; then
 ! 				dhcp_interfaces="$dhcp_interfaces $ifn"
 ! 			fi
 ! ###
 ! ###
   			eval showstat_$ifn=1
   			;;
   		*)
 
 --==_Exmh_-2152329320
 Content-Type: text/plain; charset=us-ascii
 
 Jan L. Peterson
 <jlp@softhome.net>
 
 --==_Exmh_-2152329320--
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: dwmalone 
State-Changed-When: Mon Aug 12 12:28:06 PDT 2002 
State-Changed-Why:  
I would have said that it would be a bug not to do DHCP if the 
interface has been configured for it and might upset people who 
want to be able to plug the network cable in at a more leasurely 
pace when they boot their laptops. 

It also means that dhclient won't be able to use a lease listed in 
its lease file, even if that lease is valid and the hub/switch/access 
point you're connected to happens to be temporally down or out of 
range. 

I'd suggest that you try reducing the timeouts if the long timeout 
isn't suitable for your setup. See the timeing options in dhclient.conf 
man page. 

I'll close the PR unless you have any objections. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38559 
State-Changed-From-To: feedback->closed 
State-Changed-By: trhodes 
State-Changed-When: Thu Jan 9 09:06:12 PST 2003 
State-Changed-Why:  
Closed.  dmalone wanted to close this several months ago, submitter has not 
responded at all. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38559 

From: Tom Rhodes <trhodes@FreeBSD.org>
To: "Jan L. Peterson" <jlp@softhome.net>
Cc: Freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/38559: rc.network hangs for a long time attempting dhcp
 setup of disconnected interface
Date: Thu, 9 Jan 2003 12:42:15 -0500

 On Thu, 9 Jan 2003 10:18:37 -0700 (MST)
 "Jan L. Peterson" <jlp@softhome.net> wrote:
 
 > > Closed.  dmalone wanted to close this several months ago, submitter
 > > has not responded at all.
 > 
 > Actually, I think I did respond... but it never made it onto the PR. 
 > I agreed that my changes could cause problems for others who have
 > interfaces that may appear and disappear while the system is up and
 > that the PR could be closed.  I will maintain my own modifications to
 > rc.network in my own local source tree (because it works for me).
 > 
 > 	-jan-
 > --
 > Jan L. Peterson
 > <jlp@softhome.net>
 > 
 > 
 
 Thank you for the reply, Jan!
>Unformatted:
