Date: Sun, 12 Jun 2011 14:45:07 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: melifaro@ipfw.ru Cc: dougb@FreeBSD.org, pluknet@gmail.com, freebsd-rc@FreeBSD.org Subject: Re: [CFR] rc.conf interface description Message-ID: <20110612.144507.1094074416533508207.hrs@allbsd.org> In-Reply-To: <4DF43813.5020508@ipfw.ru> References: <BANLkTikfoQtgVv2Vnkg6Fn4kq68qjqpWRw@mail.gmail.com> <20110612.055610.725598761140735688.hrs@allbsd.org> <4DF43813.5020508@ipfw.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Sun_Jun_12_14_45_07_2011_678)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Jun_12_14_45_07_2011_590)--" Content-Transfer-Encoding: 7bit ----Next_Part(Sun_Jun_12_14_45_07_2011_590)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Alexander V. Chernikov" <melifaro@ipfw.ru> wrote in <4DF43813.5020508@ipfw.ru>: me> -----BEGIN PGP SIGNED MESSAGE----- me> Hash: SHA1 me> me> Hiroki Sato wrote: me> > Sergey Kandaurov <pluknet@gmail.com> wrote me> > in <BANLkTikfoQtgVv2Vnkg6Fn4kq68qjqpWRw@mail.gmail.com>: me> > me> > pl> Hello. me> > pl> me> > pl> Some time ago there was a discussion about ifconfig descr integration me> > pl> into rc. That means you can store interface descriptions in rc.conf file, me> > pl> so that the descriptions survive between system reboots. To achieve it, me> > pl> you need to place one-line option into rc.conf, e.g. like this: me> > pl> ifconfig_em0_descr="Uplink to Gigabit Switch 1", or me> > pl> ifconfig_vlan8_descr="description '1 2 3' vlan 255 vlandev IFACE" me> > pl> me> > pl> so after reboot or manual `rc.d/netif restart $iface` invocation, you''ll see me> > pl> something like this: me> > pl> vlan8: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 me> > pl> description: description '1 2 3' vlan 255 vlandev IFACE me> > pl> [...] me> > pl> And rc.d/netif stop $iface removes description from a network interface. me> > pl> me> > pl> You can see the previous discussion in -current@ and -rc@ mail archives: me> > pl> http://www.mail-archive.com/freebsd-current@freebsd.org/msg124513.html me> > pl> However, that time it went nowhere due to luck of time/interest. me> > pl> me> > pl> Recently I learned that this patch is actually used. me> > pl> I was requested to integrate it into the head. me> > pl> I'd like to collect your opinions/objections/thoughts to ensure whether me> > pl> there are might be issues preventing from committing it. me> > me> > I have no strong objection but I am still wondering if we really need me> > to have the dedicated variable for ifconfig descr. Is simply me> > specifying ifconfig_IF="descr FOO" not enough? me> me> Unfortunately it is not. You can't (easily) set interface description me> like 'FOO BAR' via ifconfig_IF. Please see conf/156675 for a bit longer me> desciption. If the primary issue is that escape characters do not work properly, the attached patch should fix that. This escape character problem may also involve other options which accept white spaces such as group, maclabel, ssid, or wepkey. I think this is a bug in the rc.d framework and supporting \ and ' in ifconfig_IF is simpler and more intuitive than having an ifconfig_IF_xxx line for each. -- Hiroki ----Next_Part(Sun_Jun_12_14_45_07_2011_590)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="network.subr_20110612-1.diff" Index: etc/network.subr =================================================================== --- etc/network.subr (revision 222996) +++ etc/network.subr (working copy) @@ -94,7 +94,7 @@ # ifconfig_IF ifconfig_args=`ifconfig_getargs $1` if [ -n "${ifconfig_args}" ]; then - ifconfig $1 ${ifconfig_args} + eval ifconfig $1 ${ifconfig_args} _cfg=0 fi ----Next_Part(Sun_Jun_12_14_45_07_2011_590)---- ----Security_Multipart0(Sun_Jun_12_14_45_07_2011_678)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk30UmMACgkQTyzT2CeTzy2YfQCfbGglKeUfxakzuBBRaol9/xDd lMkAnRW+p6P1Al2GICHmRdNZ3RgdoxQh =qkoA -----END PGP SIGNATURE----- ----Security_Multipart0(Sun_Jun_12_14_45_07_2011_678)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110612.144507.1094074416533508207.hrs>