From card@ens.uvsq.fr Thu Aug  5 05:43:42 1999
Return-Path: <card@ens.uvsq.fr>
Received: from soleil.uvsq.fr (soleil.uvsq.fr [193.51.24.1])
	by hub.freebsd.org (Postfix) with ESMTP id C3052151DA
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  5 Aug 1999 05:43:39 -0700 (PDT)
	(envelope-from card@ens.uvsq.fr)
Received: from atlas.ens.uvsq.fr (atlas.ens.uvsq.fr [193.51.26.1])
          by soleil.uvsq.fr (8.9.3/jtpda-5.3.2) with ESMTP id OAA50794
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 5 Aug 1999 14:43:29 +0200 (CEST)
Received: from alsace.ens.uvsq.fr (alsace.ens.uvsq.fr [193.51.26.20])
          by atlas.ens.uvsq.fr (8.9.3/jtpda-5.2) with ESMTP id OAA40059
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 5 Aug 1999 14:43:29 +0200 (CEST)
Received: from (card@localhost)
          by alsace.ens.uvsq.fr (8.9.3/jtpda-5.2) id OAA00777
          ; Thu, 5 Aug 1999 14:43:29 +0200 (CEST)
Message-Id: <199908051243.OAA00777@alsace.ens.uvsq.fr>
Date: Thu, 5 Aug 1999 14:43:29 +0200 (CEST)
From: card@ens.uvsq.fr (Remy Card)
Reply-To: card@csi.uvsq.fr
To: FreeBSD-gnats-submit@freebsd.org
Subject: No dhclient support in /etc/rc*
X-Send-Pr-Version: 3.2

>Number:         12984
>Category:       conf
>Synopsis:       /etc/rc* does not contain any support for dhclient
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug  5 05:50:01 PDT 1999
>Closed-Date:    Fri Dec 17 12:36:32 PST 1999
>Last-Modified:  Fri Dec 17 12:37:30 PST 1999
>Originator:     Remy Card
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
CSI - UVSQ
>Environment:

	3.2-RELEASE and 3.2-STABLE

>Description:

	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
not include any support for it.  Thus, it is not possible to use DHCP to
set the IP address without modifying these scripts.

>How-To-Repeat:

	

>Fix:
	
	Apply the following patch that adds dhclient support in /etc/rc.network
and /etc/defaults/rc.conf.  This patch includes the changes made in the
current version of /etc/rc*.

--- usr/src/etc/defaults/rc.conf	Tue May 11 14:21:22 1999
+++ etc/defaults/rc.conf	Thu Aug  5 14:20:28 1999
@@ -31,6 +31,8 @@
 ### Basic network options: ###
 hostname="myname.my.domain"	# Set this!
 nisdomainname="NO"		# Set to NIS domain if using NIS (or NO).
+dhcp_program="/sbin/dhclient"	# Path to dhcp client program.
+dhcp_flags=""			# Additional flags to pass to dhcp client.
 firewall_enable="NO"		# Set to YES to enable firewall functionality
 firewall_script="/etc/rc.firewall" # Which script to run to set up the firewall
 firewall_type="UNKNOWN"		# Firewall type (see /etc/rc.firewall)
--- usr/src/etc/rc.network	Mon Apr 12 17:29:11 1999
+++ etc/rc.network	Wed Aug  4 18:53:35 1999
@@ -58,7 +58,12 @@
 	    # Do the primary ifconfig if specified
 	    eval ifconfig_args=\$ifconfig_${ifn}
 	    if [ -n "${ifconfig_args}" ] ; then
-		    ifconfig ${ifn} ${ifconfig_args}
+		# See if we are using DHCP
+		if [ X"${ifconfig_args}" = X"DHCP" ]; then
+			${dhcp_program} ${dhcp_flags} ${ifn}
+		else
+		    	ifconfig ${ifn} ${ifconfig_args}
+		fi
 	    fi
 	    # Check to see if aliases need to be added
 	    alias=0


>Release-Note:
>Audit-Trail:

From: "Jasper O'Malley" <jooji@webnology.com>
To: card@csi.uvsq.fr
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/12984: No dhclient support in /etc/rc*
Date: Thu, 5 Aug 1999 10:28:50 -0500 (CDT)

 On Thu, 5 Aug 1999, Remy Card wrote:
 
 > 	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
 > not include any support for it.  Thus, it is not possible to use DHCP to
 > set the IP address without modifying these scripts.
 
 Sure it is. /etc/rc.network looks for the file /etc/start_if.${ifn} for
 each interface ${ifn} listed in rc.conf, and runs it if present. If you
 want to use dhclient to lease an address on fxp0, for instance, make a
 file /etc/start_if.fxp0 with the following lines in it:
 
     #!/bin/sh
     /sbin/dhclient fxp0
 
 The patch looks okay, too, though. There's something appealing about being
 able to simply stick ifconfig_fxp0="DHCP" in rc.conf, and not have to muck
 with a start_if script. I'd suggest calling the new rc.conf variable
 something like dhcpc_program, instead of just dhcp_program, to avoid
 confusion with a possible future DHCP server program variable.
 
 Cheers,
 Mick
 
 
 
 
 

From: Doug <Doug@gorean.org>
To: card@csi.uvsq.fr
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/12984: No dhclient support in /etc/rc*
Date: Thu, 5 Aug 1999 10:46:46 -0700 (PDT)

 On Thu, 5 Aug 1999, Remy Card wrote:
 
 > 	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
 > not include any support for it.  Thus, it is not possible to use DHCP to
 > set the IP address without modifying these scripts.
 
 > 	Apply the following patch that adds dhclient support in /etc/rc.network
 > and /etc/defaults/rc.conf.  This patch includes the changes made in the
 > current version of /etc/rc*.
 
 	While I agree that we need better support for dhcp in the rc*
 scripts, I do not believe that your patch is the correct approach. There
 are many things you can do with dhcp other than just ifconfig'ing an
 interface, so the support needs to be more thorough than that. 
 
 	For one approach on using the start_if* approach see
 http://home.san.rr.com/freebsd/dhcp.html. I'm working on a more complete
 approach for dhcp support, if you'd be willing to test what I come up with
 send me a private e-mail and we can work something out. 
 
 Doug
 -- 
 On account of being a democracy and run by the people, we are the only
 nation in the world that has to keep a government four years, no matter
 what it does.
                 -- Will Rogers
 
 

From: Nick Hibma <nick.hibma@jrc.it>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: conf/12984: No dhclient support in /etc/rc* (fwd)
Date: Thu, 12 Aug 1999 10:13:27 +0200 (MET DST)

 ---------- Forwarded message ----------
 Date: 11 Aug 1999 14:41:38 -0400
 From: Lowell Gilbert <lowell@world.std.com>
 To: Nick Hibma <nick.hibma@jrc.it>
 Subject: Re: conf/12984: No dhclient support in /etc/rc*
 
 Nick Hibma <nick.hibma@jrc.it> writes:
 
 >  >  with a start_if script. I'd suggest calling the new rc.conf variable
 >  >  something like dhcpc_program, instead of just dhcp_program, to avoid
 >  >  confusion with a possible future DHCP server program variable.
 > 
 > Making rc.conf depend on the version or make of the program is a bad
 > idea. Specifying it at all is a bad thing as we have a dhcp client in
 > the base distribution, so that should be used.
 
 I'm not completely sure I understand the point of the first sentence,
 but I don't see why this is any different than lpd, sendmail, portmap,
 bind, and so on.  Given that there *are* alternatives, making it
 possible to use them through the same mechanism as the system's
 "stock" program seems quite reasonable.
 
  - Lowell
 
 

From: Johan Karlsson <k@numeri.campus.luth.se>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: conf/12984: /etc/rc* does not contain any support for dhclient
Date: Mon, 13 Dec 1999 21:50:15 +0100

 Please close this PR since a similar patch has been commited to both
 current and stable.
 
 /K
 
 --
 Johan Karlsson          mailto:k@numeri.campus.luth.se
 
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Fri Dec 17 12:36:32 PST 1999 
State-Changed-Why:  
A similar patch has already been committed to both -current and -stable. 
>Unformatted:
