From nobody@FreeBSD.org  Fri Aug  6 05:50:26 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED6271065674
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Aug 2010 05:50:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id CE1298FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Aug 2010 05:50:26 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o765oQjv006706
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 6 Aug 2010 05:50:26 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o765oQ6F006705;
	Fri, 6 Aug 2010 05:50:26 GMT
	(envelope-from nobody)
Message-Id: <201008060550.o765oQ6F006705@www.freebsd.org>
Date: Fri, 6 Aug 2010 05:50:26 GMT
From: Jin Guojun <jguojun@sbcglobal.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: DHCP can make one interface to have multiple IP addresses
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         149351
>Category:       bin
>Synopsis:       [request] dhclient(8): DHCP can make one interface to have multiple IP addresses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 06 06:00:17 UTC 2010
>Closed-Date:    Tue Sep 21 07:57:27 UTC 2010
>Last-Modified:  Tue Sep 21 07:57:27 UTC 2010
>Originator:     Jin Guojun
>Release:        RELEAE-8.1
>Organization:
VFFS
>Environment:
>Description:
When DHCP server is down, manually configured rl0 to an IP -- 192.168.0.10 -- for temporarily use.
As DHCP came back and assigned  another IP on the rl0, now NIC is down
due to two conflict IP addresses.

rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 00:40:f4:d1:23:9a
        inet 192.168.0.10 netmask 0xffffff00 broadcast 192.168.0.255
        inet 10.10.50.126 netmask 0xffffff00 broadcast 10.10.50.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500

DHCP should work as ifconfig to replace the old IP with new IP, not set additional IP on an interface.
>How-To-Repeat:
Configure an interface (say rl0) to use DHCP.
Boot machine with network Ethernet cable unplugged.
After machine boot up, ifconfig rl0 to some IP not in DHCP range.
Plug in Ethernet cable and wait for a while to let DHCP active.
You will see two IPs on the Ethernet interface.
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: vwe 
State-Changed-When: Sun Aug 15 21:09:54 UTC 2010 
State-Changed-Why:  
Jin, I think most developers will agree with the current behavior of dhclient. 
On the other side, I can really understand your point. Best would be to have it in the hand of the user to have just one single IP address on a DHCP configured interface, so it needs a parameter to dhclient. 
Please feel free to send in patches. Until one is attached, we're putting this PR on hold. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149351 
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Mon Sep 6 09:26:37 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149351 
State-Changed-From-To: suspended->patched 
State-Changed-By: brian 
State-Changed-When: Mon Sep 6 09:59:21 UTC 2010 
State-Changed-Why:  
Retaining existing IP numbers on an interface is a feature. 
I've documented how disable this behaviour with r212253 and 
will MFC in two weeks. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/149351: commit references a PR
Date: Mon,  6 Sep 2010 09:59:20 +0000 (UTC)

 Author: brian
 Date: Mon Sep  6 09:59:10 2010
 New Revision: 212253
 URL: http://svn.freebsd.org/changeset/base/212253
 
 Log:
   Document dhclient-enter-hooks and dhclient-exit-hooks and mention
   how to configure dhclient to clear the interface of IP numbers prior
   to configuring it.
   
   PR:		149351
   MFC after:	2 weeks
 
 Modified:
   head/sbin/dhclient/dhclient-script.8
 
 Modified: head/sbin/dhclient/dhclient-script.8
 ==============================================================================
 --- head/sbin/dhclient/dhclient-script.8	Mon Sep  6 07:35:13 2010	(r212252)
 +++ head/sbin/dhclient/dhclient-script.8	Mon Sep  6 09:59:10 2010	(r212253)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd January 1, 1997
 +.Dd September 6, 2010
  .Dt DHCLIENT-SCRIPT 8
  .Os
  .Sh NAME
 @@ -218,6 +218,29 @@ if it has reason to believe they are val
  If not, it should exit with a nonzero value.
  .El
  .Pp
 +Before taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-enter-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +After taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-exit-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +These hooks scripts can be used to dynamically modify the enviornment at
 +appropriate times during the DHCP negotiations.
 +For example, if the administrator wishes to disable alias IP numbers on
 +the DHCP interface, they might want to put the following in
 +.Pa /etc/dhclient-enter-hooks :
 +.Bd -literal -offset indent
 +[ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0
 +.Ed
 +.Pp
  The usual way to test a lease is to set up the network as with
  .Li REBIND
  (since this may be called to test more than one lease) and then ping
 @@ -239,6 +262,7 @@ but current scripts do not do this.
  .\" and bear the names of the operating systems on which they are intended
  .\" to work.
  .Sh SEE ALSO
 +.Xr sh 1 ,
  .Xr dhclient.conf 5 ,
  .Xr dhclient.leases 5 ,
  .Xr dhclient 8 ,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/149351: commit references a PR
Date: Tue, 21 Sep 2010 07:44:02 +0000 (UTC)

 Author: brian
 Date: Tue Sep 21 07:43:56 2010
 New Revision: 212955
 URL: http://svn.freebsd.org/changeset/base/212955
 
 Log:
   MFC r212253: Document how to use dhclient-{enter,exit}-hooks.
   
   PR:		149351
 
 Modified:
   stable/8/sbin/dhclient/dhclient-script.8
 Directory Properties:
   stable/8/sbin/dhclient/   (props changed)
 
 Modified: stable/8/sbin/dhclient/dhclient-script.8
 ==============================================================================
 --- stable/8/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:03:53 2010	(r212954)
 +++ stable/8/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:43:56 2010	(r212955)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd January 1, 1997
 +.Dd September 6, 2010
  .Dt DHCLIENT-SCRIPT 8
  .Os
  .Sh NAME
 @@ -218,6 +218,29 @@ if it has reason to believe they are val
  If not, it should exit with a nonzero value.
  .El
  .Pp
 +Before taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-enter-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +After taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-exit-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +These hooks scripts can be used to dynamically modify the enviornment at
 +appropriate times during the DHCP negotiations.
 +For example, if the administrator wishes to disable alias IP numbers on
 +the DHCP interface, they might want to put the following in
 +.Pa /etc/dhclient-enter-hooks :
 +.Bd -literal -offset indent
 +[ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0
 +.Ed
 +.Pp
  The usual way to test a lease is to set up the network as with
  .Li REBIND
  (since this may be called to test more than one lease) and then ping
 @@ -239,6 +262,7 @@ but current scripts do not do this.
  .\" and bear the names of the operating systems on which they are intended
  .\" to work.
  .Sh SEE ALSO
 +.Xr sh 1 ,
  .Xr dhclient.conf 5 ,
  .Xr dhclient.leases 5 ,
  .Xr dhclient 8 ,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/149351: commit references a PR
Date: Tue, 21 Sep 2010 07:44:45 +0000 (UTC)

 Author: brian
 Date: Tue Sep 21 07:44:40 2010
 New Revision: 212956
 URL: http://svn.freebsd.org/changeset/base/212956
 
 Log:
   MFC r212253: Document how to use dhclient-{enter,exit}-hooks.
   
   PR:		149351
 
 Modified:
   stable/7/sbin/dhclient/dhclient-script.8
 Directory Properties:
   stable/7/sbin/dhclient/   (props changed)
 
 Modified: stable/7/sbin/dhclient/dhclient-script.8
 ==============================================================================
 --- stable/7/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:43:56 2010	(r212955)
 +++ stable/7/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:44:40 2010	(r212956)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd January 1, 1997
 +.Dd September 6, 2010
  .Dt DHCLIENT-SCRIPT 8
  .Os
  .Sh NAME
 @@ -218,6 +218,29 @@ if it has reason to believe they are val
  If not, it should exit with a nonzero value.
  .El
  .Pp
 +Before taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-enter-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +After taking action according to
 +.Va $reason ,
 +.Nm
 +will check for the existence of
 +.Pa /etc/dhclient-exit-hooks .
 +If found, it will be sourced
 +.Pq see Xr sh 1 .
 +These hooks scripts can be used to dynamically modify the enviornment at
 +appropriate times during the DHCP negotiations.
 +For example, if the administrator wishes to disable alias IP numbers on
 +the DHCP interface, they might want to put the following in
 +.Pa /etc/dhclient-enter-hooks :
 +.Bd -literal -offset indent
 +[ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0
 +.Ed
 +.Pp
  The usual way to test a lease is to set up the network as with
  .Li REBIND
  (since this may be called to test more than one lease) and then ping
 @@ -239,6 +262,7 @@ but current scripts do not do this.
  .\" and bear the names of the operating systems on which they are intended
  .\" to work.
  .Sh SEE ALSO
 +.Xr sh 1 ,
  .Xr dhclient.conf 5 ,
  .Xr dhclient.leases 5 ,
  .Xr dhclient 8 ,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: brian 
State-Changed-When: Tue Sep 21 07:56:14 UTC 2010 
State-Changed-Why:  
Document updates merged to stable/8 (r212955) and stable/7 (r212956). 

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