From owner-freebsd-bugs Tue May 11 12:30: 4 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 8F72B156D7 for ; Tue, 11 May 1999 12:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id MAA69759; Tue, 11 May 1999 12:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from annwn.phys.washington.edu (annwn.phys.washington.edu [128.95.93.180]) by hub.freebsd.org (Postfix) with ESMTP id 81A7F14BEE for ; 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" Reply-To: somsky@annwn.phys.washington.edu To: FreeBSD-gnats-submit@freebsd.org Cc: somsky@annwn.phys.washington.edu X-Send-Pr-Version: 3.2 Subject: misc/11653: patch to allow DHCP configuration of interfaces through rc.conf Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11653 >Category: misc >Synopsis: patch to allow DHCP configuration of interfaces through rc.conf >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 11 12:30:00 PDT 1999 >Closed-Date: >Last-Modified: >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_="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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message