From neil@router.darlow.co.uk  Sat Sep  8 15:06:24 2001
Return-Path: <neil@router.darlow.co.uk>
Received: from router.darlow.co.uk (pc2-bigg2-0-cust101.lut.cable.ntl.com [213.107.35.101])
	by hub.freebsd.org (Postfix) with ESMTP id 4B62F37B40A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  8 Sep 2001 15:06:23 -0700 (PDT)
Received: (from neil@localhost)
	by router.darlow.co.uk (8.11.3/8.11.3) id f88M6Lo06370;
	Sat, 8 Sep 2001 23:06:21 +0100 (BST)
	(envelope-from neil)
Message-Id: <200109082206.f88M6Lo06370@router.darlow.co.uk>
Date: Sat, 8 Sep 2001 23:06:21 +0100 (BST)
From: neil@darlow.co.uk
Reply-To: neil@darlow.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Can't set interface arguments for dhcp configured interface
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         30441
>Category:       conf
>Synopsis:       Can't set interface arguments for dhcp configured interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 08 15:10:00 PDT 2001
>Closed-Date:    Sun Feb 02 04:49:00 PST 2003
>Last-Modified:  Sun Feb 02 04:49:00 PST 2003
>Originator:     Neil Darlow
>Release:        FreeBSD 4.3-RELEASE-p17 i386
>Organization:
Neil Darlow Consulting, UK
>Environment:
>Description:
/etc/rc.network groups interfaces marked "dhcp" and starts
the dhcp-program for them. It doesn't process any additional arguments that
have been passed on the ifconfig_* line of /etc/rc.conf e.g. media.
>How-To-Repeat:
ifconfig_rl0="dhcp media 10baseT/UTP"
>Fix:
/etc/rc.network should have some means of parsing interface
arguments/options for dhcp configured interfaces
>Release-Note:
>Audit-Trail:

From: Neil Bliss <nbliss@mvista.com>
To: freebsd-gnats-submit@freebsd.org
Cc: neil@darlow.co.uk, audit@freebsd.org, nbliss@mvista.com
Subject: Re: conf/30441: Can't set interface arguments for dhcp configured interfaces
Date: Wed, 8 May 2002 11:59:56 -0700

 Hey folks,
 
 I just ran into this problem, and here's my proposed fix for it.  Feel free to
 incorporate it, or not. =)
 
 Index: rc.network
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc.network,v
 retrieving revision 1.134
 diff -c -r1.134 rc.network
 *** rc.network  2002/04/11 22:06:27     1.134
 --- rc.network  2002/05/08 19:01:20
 ***************
 *** 211,219 ****
                 case ${ifconfig_args} in
                 '')
                         ;;
 !               [Dd][Hh][Cc][Pp])
                         # DHCP inits are done all in one go below
                         dhcp_interfaces="$dhcp_interfaces $ifn"
                         eval showstat_$ifn=1
                         ;;
                 *)
 --- 211,225 ----
                 case ${ifconfig_args} in
                 '')
                         ;;
 !               [Dd][Hh][Cc][Pp])
                         # DHCP inits are done all in one go below
                         dhcp_interfaces="$dhcp_interfaces $ifn"
                         eval showstat_$ifn=1
                         ;;
                 *)
 --- 211,225 ----
                 case ${ifconfig_args} in
                 '')
                         ;;
 !               *[Dd][Hh][Cc][Pp]*)
                         # DHCP inits are done all in one go below
                         dhcp_interfaces="$dhcp_interfaces $ifn"
 +                       # eat the DHCP token, and apply any other args.
 +                       ifconfig_args=`echo $ifconfig_args \
 +                               | sed s/[Dd][Hh][Cc][Pp]//`
 +                       if [ -n "${ifconfig_args}" ]; then
 +                               ifconfig ${ifn} ${ifconfig_args}
 +                       fi
                         eval showstat_$ifn=1
                         ;;
                 *)
 
 
 later,
 
 Neil
 
 -- 
 Neil Bliss - Monta Vista Technical Support
 Yow!-Zippy-says: I once decorated my apartment entirely in ten foot salad forks!!

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Neil Bliss <nbliss@mvista.com>
Cc: "Crist J. Clark" <cjc@freebsd.org>, freebsd-bugs@freebsd.org
Subject: Re: conf/30441: Can't set interface arguments for dhcp configured interfaces 
Date: Mon, 13 May 2002 19:25:31 +0100

 In message <20020513091319.G7743@dhcp117.mvista.com>, Neil Bliss writes:
 >Actually, it's not anything to do with the dhcp client.  What you're needing to
 >be able to do here is to be able to pass any additional ifconfig arguments that
 >the card will need to be able to be used.  In my particular case, I'm using a 
 >wireless ethernet card, and I need to give it the correct ssid for it to get
 >signal at ifconfig time.  With the current setup, if I'd like this interface to
 >use dhcp, then that's the *only* thing you can tell rc.network about this card.
 
 dhclient.conf is actually a much more useful place to put such
 commands, because dhclient can automatically cycle through different
 combinations of ifconfig settings, picking the first one on which
 it successfully gets a lease (thanks to Kurt Lidl for pointing this
 out to me a while ago). For example, I use something like this:
 
 	interface "wi0" {
 		media
 			"wepmode on wepkey 0x0000000000",
 			"wepmode on wepkey 0x1111111111",
 			"wepmode off";
 	}
 
 You can list the settings for any networks you use, and then plugging
 in the card just works where ever you are.
 
 Ian
State-Changed-From-To: open->feedback 
State-Changed-By: cjc 
State-Changed-When: Mon May 13 23:34:27 PDT 2002 
State-Changed-Why:  
I think Ian's example (which was added to the audit trail) more 
clearly illustrates the point I was trying to make. If you use DHCP to 
configure your interface, you should use DHCP to configure your 
interface. The right place for additional interface configuration is 
dhclient.conf(5) not rc.conf(5). 

Is there some interface configuration that you still cannot accomplish 
through dhclient.conf(5)? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30441 
State-Changed-From-To: feedback->closed 
State-Changed-By: dougb 
State-Changed-When: Sun Feb 2 04:48:26 PST 2003 
State-Changed-Why:  

dhclient.conf is the proper place to handle this. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Feb 2 04:48:26 PST 2003 
Responsible-Changed-Why:  

I closed this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30441 
>Unformatted:
 >System: FreeBSD router.darlow.co.uk 4.3-RELEASE-p17 FreeBSD 4.3-RELEASE-p17 #0: Fri Sep 7 12:05:51 BST 2001 root@router.darlow.co.uk:/usr/obj/usr/src/sys/ROUTER i386
