From dak@wanadoo.fr  Sun Aug 25 10:21:34 2002
Return-Path: <dak@wanadoo.fr>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 17E5937B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 25 Aug 2002 10:21:34 -0700 (PDT)
Received: from nebula.wanadoo.fr (ca-sqy-3-183.abo.wanadoo.fr [80.8.56.183])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2F1C343E3B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 25 Aug 2002 10:21:32 -0700 (PDT)
	(envelope-from dak@wanadoo.fr)
Received: from nebula.wanadoo.fr (localhost [127.0.0.1])
	by nebula.wanadoo.fr (8.12.5/8.12.5) with ESMTP id g7PHI9r6003664
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 25 Aug 2002 19:18:09 +0200 (CEST)
	(envelope-from dak@nebula.wanadoo.fr)
Received: (from dak@localhost)
	by nebula.wanadoo.fr (8.12.5/8.12.5/Submit) id g7PHI8S2003663;
	Sun, 25 Aug 2002 19:18:08 +0200 (CEST)
Message-Id: <200208251718.g7PHI8S2003663@nebula.wanadoo.fr>
Date: Sun, 25 Aug 2002 19:18:08 +0200 (CEST)
From: Aurelien Nephtali <aurelien.nephtali@wanadoo.fr>
Reply-To: Aurelien Nephtali <aurelien.nephtali@wanadoo.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: dhclient running + non-existent interface = CPU 100%
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42005
>Category:       bin
>Synopsis:       dhclient running + non-existent interface = CPU 100%
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    mbr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 25 10:30:01 PDT 2002
>Closed-Date:    Mon Feb 10 01:47:23 PST 2003
>Last-Modified:  Mon Feb 10 01:47:23 PST 2003
>Originator:     Aurelien Nephtali <aurelien.nephtali@wanadoo.fr>
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
none
>Environment:
System: FreeBSD nebula.wanadoo.fr 4.6-STABLE FreeBSD 4.6-STABLE #144: Sun Aug 25 10:38:56 CEST 2002 dak@nebula.wanadoo.fr:/usr/src/sys/compile/NEBULA i386

>Description:
	When a net interface disappears and if a 'dhclient' is attached to this interface,
	the CPU rise to 100% and the log message 'receive_packet on X: Device not configured'
	goes to /var/log/messages.
	This is a know problem (someone already complains on -stable i think) but apparently
	it wasn't fixed (yet). This problem is only on laptops with PCMCIA NIC.
	
>How-To-Repeat:
	dhclient <interface> and remove the NIC.
>Fix:
	Apply this patch from /usr/src. I choose to exit the soft since
	it's not usefull to have it running if no interface is present and
	moreover a new dhclient X is needed if the NIC is re-plugged.
	

--- discover.c.patch begins here ---
--- contrib/isc-dhcp/common/discover.c	Thu Apr 11 12:16:46 2002
+++ contrib/isc-dhcp/common/discover.c	Sat Aug 24 22:40:13 2002
@@ -756,7 +756,8 @@
 	if ((result =
 	     receive_packet (ip, u.packbuf, sizeof u, &from, &hfrom)) < 0) {
 		log_error ("receive_packet failed on %s: %m", ip -> name);
-		return ISC_R_UNEXPECTED;
+		exit(ISC_R_UNEXPECTED);
+		/*return ISC_R_UNEXPECTED;*/
 	}
 	if (result == 0)
 		return ISC_R_UNEXPECTED;
--- discover.c.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mbr 
State-Changed-When: Mon Feb 10 01:44:28 PST 2003 
State-Changed-Why:  
I'm working on a similar solution. The fix in this 
PR is not really a good solution. 

What we need is a dhclient which polls the state of the 
interface and does query the DHCP-Server again when the 
link is up again. 


Responsible-Changed-From-To: freebsd-bugs->mbr 
Responsible-Changed-By: mbr 
Responsible-Changed-When: Mon Feb 10 01:44:28 PST 2003 
Responsible-Changed-Why:  
Take this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42005 
>Unformatted:
