From nobody@FreeBSD.org  Sun Jan 16 13:46:11 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 200B416A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Jan 2005 13:46:11 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BDB0843D3F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Jan 2005 13:46:10 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0GDkABF049752
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Jan 2005 13:46:10 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0GDkAfS049750;
	Sun, 16 Jan 2005 13:46:10 GMT
	(envelope-from nobody)
Message-Id: <200501161346.j0GDkAfS049750@www.freebsd.org>
Date: Sun, 16 Jan 2005 13:46:10 GMT
From: Erik Norgaard <norgaard@locolomo.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: dhclient resets configured interfaces on startup
X-Send-Pr-Version: www-2.3

>Number:         76305
>Category:       bin
>Synopsis:       dhclient resets configured interfaces on startup
>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:   Sun Jan 16 13:50:20 GMT 2005
>Closed-Date:    Sat Jul 30 01:34:16 GMT 2005
>Last-Modified:  Sat Jul 30 01:34:16 GMT 2005
>Originator:     Erik Norgaard
>Release:        6.0-CURRENT
>Organization:
N/A
>Environment:
FreeBSD charm.daemonsecurity.com 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Thu Jan 13 10:10:51 CET 2005 norgaard@charm.daemonsecurity.com:/usr/obj/usr/src/sys/CURRENT  i386

>Description:
This problem report mentions two problems, I believe them to be sufficiently related that they can go in one report.

On startup, dhclient will reset (ie set ip to 0.0.0.0) the interface regardless if it has been previously configured (ie by bootp at boot). If starting up dhclient for one interface, any other interface previously configured with dhclient will be reset.

The -n option (do not configure any interface) does not work (it works like -nw, become daemon emidiately).

The consequenses are that you cannot configure two interfaces with dhclient separately, this is most likely because dhclient uses only one lease file, rather than one per interface. 

It only makes sense to reset interfaces if there are conflicts, ie. coinciding network addresses, but then the second interface configuration should fail.

For diskless clients with interface configured at boot, the diskless client will loose contact with the nfs server when the interface is reset and hang. 

It is not clear to me if the problem is that dhclient attempts to write the lease file on the nfs-mounted /var share before configuring the interface.

The description provided in the handbook on how to setup diskless clients won't work since one cannot get hold of the swap options, or other user specified dhcp options - this could be documentation that needs update though.

Desired operation: 

If dhclient is starting up for one interface, any other interface should be left as is regardless of how it has been configured. This could be solved by using one leasefile per interface. 

The startup of dhclient should fail if the dhcp offer is an address on a previously configured network on a different interface.

If dhclient is started with -n option and the interface is configured, the request sent should be for lease renewal rather than for a new lease.
>How-To-Repeat:
a) Host with two interfaces (eg xl0 and xl1), try start dhclient as follows:

# dhclient xl0
# dhclient xl1

keep an eye on how interfaces are configured with ifconfig. The second dhclient will fail and exit silently after having reset xl0, the first dhclient will be unable to reconfigure xl0 - a restart is needed.

b) diskless setup, let the host start dhclient on boot. 

Note: on freebsd 5.3 the diskless client can use memory filesystems for /var, I haven't tried if this solves the problem, however this is only a viable solution if the host has enough ram.
>Fix:

>Release-Note:
>Audit-Trail:

From: Erik Norgaard <norgaard@locolomo.org>
To: freebsd-gnats-submit@FreeBSD.org, norgaard@locolomo.org
Cc:  
Subject: Re: bin/76305: dhclient resets configured interfaces on startup
Date: Fri, 21 Jan 2005 20:45:09 +0100

 It appears from the status report that at least issue a) above will be 
 resolved with the dhclient from OpenBSD. It has been ported but awaits 
 importing into the tree.
 
 I have contacting Sam Leffler (sam at FreeBSD dot org) to hear if I can 
 help testing, but have received no reply yet - sorry if I'm impatient 
 :-) If I can help testing please let me know how/where to fetch the 
 ported source.
 
 Thanks, Erik
 
 PS: Sorry for the lack of linewrapping in previous post - the web 
 interface doesn't wrap it all up.
 
 -- 
 Ph: +34.666334818                           web: http://www.locolomo.org
 S/MIME Certificate: http://www.locolomo.org/crt/2004071206.crt
 Subject ID:  A9:76:7A:ED:06:95:2B:8D:48:97:CE:F2:3F:42:C8:F2:22:DE:4C:B9
 Fingerprint: 4A:E8:63:38:46:F6:9A:5D:B4:DC:29:41:3F:62:D3:0A:73:25:67:C2
State-Changed-From-To: open->feedback 
State-Changed-By: arved 
State-Changed-When: Tue Jun 7 18:00:19 GMT 2005 
State-Changed-Why:  
OpenBSD's dhclient has been imported into CURRENT. 

Does this solve your problems? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76305 
State-Changed-From-To: feedback->closed 
State-Changed-By: kris 
State-Changed-When: Sat Jul 30 01:34:05 GMT 2005 
State-Changed-Why:  
Feedback timeout 

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