From owner-freebsd-hackers Mon Sep 10 11:28:37 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 0A6C037B407 for ; Mon, 10 Sep 2001 11:28:25 -0700 (PDT) Received: from laptop.baldwin.cx (john@[147.11.46.201]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id LAA18026; Mon, 10 Sep 2001 11:27:45 -0700 (PDT) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010910101239.A28442@Odin.AC.HMC.Edu> Date: Mon, 10 Sep 2001 11:27:37 -0700 (PDT) From: John Baldwin To: Brooks Davis Subject: Re: Question about what programs to use in /etc/rc* Cc: hackers@FreeBSD.org, Adrian Filipi-Martin , Ulf Zimmermann Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 -- 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