Bug 13548

Summary: MFC use of DHCP as pseudo ifconfig option
Product: Base System Reporter: brooks <brooks>
Component: confAssignee: jkh
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
ifconfig-dhcp.diff none

Description brooks 1999-09-02 23:00:01 UTC
Current has had support for DHCP on normal (non PCMCIA) interface
cards since mid July (rc.network 1.50 and rc.conf 1.21).  This should
be in stable.  It's been in my tree pretty much since JHK added it
to current to it should be ok.  This appears to be the only reliable
way for a laptop with a docking station that has ethernet in it to
work.

Fix: Here's a diff if my src/etc generated with:
cvs -q diff -u | uuencode ifconfig-dhcp.diff

The X's in the check for ifconfig_args = DHCP are gone in current.
Comment 1 Sheldon Hearn 1999-09-03 07:18:55 UTC
On Thu, 02 Sep 1999 14:51:35 MST, brooks@one-eyed-alien.net wrote:

> Here's a diff if my src/etc generated with:
> cvs -q diff -u | uuencode ifconfig-dhcp.diff

Small diff like this deserves to be sent without encoding. :-)

Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.39.2.10
diff -u -r1.39.2.10 rc.network
--- rc.network	1999/08/29 14:18:56	1.39.2.10
+++ rc.network	1999/09/01 16:45:09
@@ -63,7 +63,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
 		    showstat=true
 	    fi
 	    # Check to see if aliases need to be added
Index: defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 rc.conf
--- rc.conf	1999/08/29 14:19:07	1.1.2.12
+++ rc.conf	1999/09/01 16:45:11
@@ -34,6 +34,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)
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-09-03 07:51:37 UTC
Responsible Changed
From-To: freebsd-bugs->jkh

The source treee's frozen. Jordan, this looks harmless, eh? 
Comment 3 jkh freebsd_committer freebsd_triage 1999-09-03 09:45:39 UTC
State Changed
From-To: open->closed

MFC approved and done 

Comment 4 brooks 1999-09-03 17:51:33 UTC
On Fri, 3 Sep 1999, Sheldon Hearn wrote:

> On Thu, 02 Sep 1999 14:51:35 MST, brooks@one-eyed-alien.net wrote:
> 
> > Here's a diff if my src/etc generated with:
> > cvs -q diff -u | uuencode ifconfig-dhcp.diff
> 
> Small diff like this deserves to be sent without encoding. :-)

I know, but I used the webform since I haven't had time to figure out what
caused my last send-pr to get stuck in my mailq.  I've got to get that
done.

-- Brooks