From somsky@annwn.phys.washington.edu Tue May 11 12:24:18 1999
Return-Path: <somsky@annwn.phys.washington.edu>
Received: from annwn.phys.washington.edu (annwn.phys.washington.edu [128.95.93.180])
	by hub.freebsd.org (Postfix) with ESMTP id 81A7F14BEE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 May 1999 12:24:12 -0700 (PDT)
	(envelope-from somsky@annwn.phys.washington.edu)
Received: (from somsky@localhost)
	by annwn.phys.washington.edu (8.9.3/8.9.3) id MAA00397;
	Tue, 11 May 1999 12:24:11 -0700 (PDT)
	(envelope-from somsky)
Message-Id: <199905111924.MAA00397@annwn.phys.washington.edu>
Date: Tue, 11 May 1999 12:24:11 -0700 (PDT)
From: "William R. Somsky" <somsky@annwn.phys.washington.edu>
Reply-To: somsky@annwn.phys.washington.edu
To: FreeBSD-gnats-submit@freebsd.org
Cc: somsky@annwn.phys.washington.edu
Subject: patch to allow DHCP configuration of interfaces through rc.conf
X-Send-Pr-Version: 3.2

>Number:         11653
>Category:       misc
>Synopsis:       patch to allow DHCP configuration of interfaces through rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 11 12:30:00 PDT 1999
>Closed-Date:    Sat Dec 11 17:49:56 PST 1999
>Last-Modified:  Sat Dec 11 17:50:34 PST 1999
>Originator:     William R. Somsky
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
University of Washington, Department of Physics
>Environment:

  Workstations in a DHCP environment with fixed (not PCMCIA/removable)
  ethernet cards.

>Description:

  In some instances, it is desireable to have a workstation with
  fixed (not PCMCIA/removable) ethernet cards to use DHCP for its
  interface configuration.  This patch allows an entry of

    ifconfig_<ifn>="DHCP"

  in the rc.conf file to mark the interface to be configured
  via DHCP and to do so upon system booting.



>How-To-Repeat:

	

>Fix:

  This patch takes the code for starting DHCP from etc/pccard_ether,
  and places a copy of it, with appropriate  "if"'s into rc.network.

  Once this patch is installed, an interface such as xl0 may be 
  configured using DHCP by putting ifconfig_xl0="DHCP" in the
  rc.conf file.
	
*** rc.network.orig	Tue May 11 12:10:26 1999
--- rc.network	Tue May 11 12:11:11 1999
***************
*** 57,63 ****
  	    fi
  	    # Do the primary ifconfig if specified
  	    eval ifconfig_args=\$ifconfig_${ifn}
! 	    if [ -n "${ifconfig_args}" ] ; then
  		    ifconfig ${ifn} ${ifconfig_args}
  	    fi
  	    # Check to see if aliases need to be added
--- 57,79 ----
  	    fi
  	    # Do the primary ifconfig if specified
  	    eval ifconfig_args=\$ifconfig_${ifn}
! 	    if [ "${ifconfig_args}" = "DHCP" ] ; then
! 		if [ -f /sbin/dhclient ] ; then
! 		    if [ -s /var/run/dhclient.pid ] ; then
! 			kill `cat /var/run/dhclient.pid`
! 			rm /var/run/dhclient.pid
! 		    fi
! 		    /sbin/dhclient
! 		elif [ -f /usr/local/sbin/dhcpc ] ; then
! 		    if [ -s /var/run/dhcpc.pid ] ; then
! 		        kill `cat /var/run/dhcpc.pid`
! 		        rm /var/run/dhcpc.pid
! 		    fi
! 		    /usr/local/sbin/dhcpc $* 
! 		else
! 		    echo "DHCP client software not available (isc-dhcp2)"
! 		fi
! 	    elif [ -n "${ifconfig_args}" ] ; then
  		    ifconfig ${ifn} ${ifconfig_args}
  	    fi
  	    # Check to see if aliases need to be added


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: billf 
Responsible-Changed-When: Tue May 11 12:46:40 PDT 1999 
Responsible-Changed-Why:  
Over to the local DHCP poobah. 

From: Bill Fenner <fenner@research.att.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/11653: patch to allow DHCP configuration of interfaces through rc.conf
Date: Fri, 14 May 1999 16:17:23 -0700

 This has nothing to do with this patch in particular, but I wanted to
 relate my experience in using dhclient on 3.1-STABLE and this seems
 a good place.
 
 If lo0 wasn't configured *before* dhclient ran, the route for my
 IP address on the interface (that goes to 127.0.0.1) would actually
 end up pointing out the interface itself, and cause millions of
 "can't allocate llinfo for 127.0.0.1" errors.  It seems like
 sysinstall tends to put lo0 last in the list, but in this case
 it's extremely important to have it first in the list.
 
   Bill
 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Sat Dec 11 17:49:56 PST 1999 
State-Changed-Why:  
Functionality has been added to FreeBSD. 
Please let us know if the implimentation is insuffient. 
Thanks. 
>Unformatted:
