Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2001 11:27:37 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        hackers@FreeBSD.org, Adrian Filipi-Martin <adrian@ubergeeks.com>, Ulf Zimmermann <ulf@Alameda.net>
Subject:   Re: Question about what programs to use in /etc/rc*
Message-ID:  <XFMail.010910112737.jhb@FreeBSD.org>
In-Reply-To: <20010910101239.A28442@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On 10-Sep-01 Brooks Davis wrote:
> On Mon, Sep 10, 2001 at 09:35:24AM -0700, Ulf Zimmermann wrote:
>> > Come to think of it, it might be as easy as:  [**UNTESTED**]
>> > 
>> > case ${ifconfig_args}; in
>> >    [Dd][Hh][Cc][Pp]*)
>> >            set $ifconfig_args
>> >            shift
>> >            ifconfig_add_args="$*"
>> >            ......
>> > 
>> > ..provided there is a requirement that the ifconfig_args should *start*
>> > with 'dhcp' (which would be easy enough to meet - right now, the args
>> > have to *be* 'dhcp', so any additional arguments would be stapled on at
>> > the end).
>> 
>> This sounds as the best solution. This would allow to set an interface
>> to be DHCP (variable dhcp_interfaces get set) and take the rest of the
>> arguments (like media/mediaopt) and apply them to the interface before
>> the dhclient gets started.
> 
> If you want to go this route, make dhcp be the last argument not the
> first one.  If ifconfig understood dhcp (on my todo list) it would have
> to be the last argument if you wanted it to work reliably because args
> are processed in order and if your interface requires that you set the
> media before it works, it's not going to work very well to run dhcp and
> then fix the media.  At least making dhcp be last insures that it will
> continue to work once ifconfig grows dhcp support[*].

ifconfig won't grok dhcp b/c no one wants it to.  I did that about a year ago
in http://people.freebsd.org/~jhb/patches/ifconfig.dhcp.patch.that.no.one.wants
(It might be a bit stale.)  You are better off fixing the ifconfig args to
allow multiple ifconfig statements much like we do with inet6 and ipx right
now.  I have this done, but again, the patch is stale.  It also centralized a
lot of duplicated cruft in /etc/pccard_ether.  This patch file is way stale,
but here it is: http://people.freebsd.org/~jhb/patches/dhcp.patch

It allows you to have any arbitrary number of ifconfig commands if you really
want.  It also adds dhcp_foo0 variables to control dhcp, and supports the
'dhcp' ifconfig case as backwards compatibility.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010910112737.jhb>