From owner-freebsd-current Sun Jul 23 22: 0: 5 2000 Delivered-To: freebsd-current@freebsd.org Received: from rina.r.dl.itc.u-tokyo.ac.jp (rina.r.dl.itc.u-tokyo.ac.jp [133.11.199.247]) by hub.freebsd.org (Postfix) with ESMTP id 1397F37B9ED; Sun, 23 Jul 2000 21:59:08 -0700 (PDT) (envelope-from tanimura@r.dl.itc.u-tokyo.ac.jp) Received: from rina.r.dl.itc.u-tokyo.ac.jp (tanimura@localhost [127.0.0.1]) by rina.r.dl.itc.u-tokyo.ac.jp (8.9.3+3.2W/3.7W-rina.r-0.1-11.01.2000) with ESMTP/IPv4 id NAA94685; Mon, 24 Jul 2000 13:58:48 +0900 (JST) Date: Mon, 24 Jul 2000 13:58:47 +0900 Message-ID: <14715.52487.753460.86952F@rina> From: Seigo Tanimura To: nsayer@quack.kfu.com Cc: hosokawa@itc.keio.ac.jp, obrien@FreeBSD.org, freebsd-current@freebsd.org Subject: Re: DHCP client problem? In-Reply-To: In your message of "Sun, 23 Jul 2000 13:26:02 -0700" <397B54DA.C55EBAE1@quack.kfu.com> References: <200007220022.RAA02194@medusa.kfu.com> <86ittyjtvd.wl@ringo.FromTo.Cc> <397B54DA.C55EBAE1@quack.kfu.com> Cc: Seigo Tanimura User-Agent: Wanderlust/1.0.3 (Notorious) SEMI/1.13.4 (Terai) FLIM/1.12.7 (=?ISO-8859-4?Q?Y=FEzaki?=) MULE XEmacs/21.1 (patch 9) (Canyonlands) (i386--freebsd) Organization: Digital Library Research Division, Information Techinology Centre, The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.13.4 - "Terai") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 23 Jul 2000 13:26:02 -0700, Nick Sayer said: Nick> Reversing that patch fixes it. Since the source for this is in contrib, Nick> I presume we Nick> need to send this back to ISC rather than patch it in our tree? Nick> Tatsumi Hosokawa wrote: (snip) >> - if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ >> - [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then >> - ifconfig $interface inet $new_ip_address $new_netmask_arg \ >> - $new_broadcast_arg $medium >> + if [ "x$old_ip_address" = "x" ] || [ "x$old_ip_address" != "x$new_ip_address" ] || \ >> + [ "x$reason" = "xBOUND" ] || [ "x$reason" = "xREBOOT" ]; then >> + ifconfig "$interface" inet "$new_ip_address" "$new_netmask_arg" \ >> + "$new_broadcast_arg" "$medium" Did you see this log? On Thu, 20 Jul 2000 02:53:11 -0700 (PDT), "David E. O'Brien" said: David> obrien 2000/07/20 02:53:11 PDT David> Modified files: David> contrib/isc-dhcp/client/scripts freebsd David> Log: David> safe shell quoting David> Obtained from: OpenBSD (rev 1.6) And I have already suggested the following fix. On Sun, 23 Jul 2000 18:53:55 +0900, Seigo Tanimura said: Seigo> 1. Seigo> This breaks ifconfig(8) in dhclient-script(8) because our ifconfig(8) Seigo> does not support both a parameter name and its argument to be in a Seigo> single argument. Seigo> What we need to do against dhclient-script(8) to prevent executing Seigo> arbitrary commands include: Seigo> - quoting the arguments from dhclient(8), and Seigo> - intializing the internal variables. Seigo> It should be a good idea to quote each argument from dhclient(8), Seigo> followed by substituting the argument to an internal variable in a way Seigo> like this: Seigo> new_netmask_arg="netmask \"$new_subnet_mask\"" Seigo> Then we do not have to quote all of the variables in dhclient-script(8). Seigo> 2. Seigo> An argument of "" is passed to ifconfig(8) if the value of $medium is Seigo> empty, making ifconfig(8) confused. This is because certain ethernet Seigo> card drivers including ed(4) do not support configuring media Seigo> types. Fortunately, the fix proposed in 1 allows us once again to Seigo> remove quotations around the arguments of ifconfig(8). I wonder if ifconfig(8) of OpenBSD supports providing both the name of a parameter and its value in a single argument, and an ampty argument... (eg ifconfig ed1 inet xxx.xxx.xxx.xxx "netmask yyy.yyy.yyy.yyy" "") -- Seigo Tanimura To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message