Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Oct 2010 23:41:41 -0400
From:      jhell <jhell@DataIX.net>
To:        pluknet <pluknet@gmail.com>
Cc:        Doug Barton <dougb@freebsd.org>, freebsd-rc@freebsd.org, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: [RFC] ifconfig description support in rc.d
Message-ID:  <4CB135F5.20804@DataIX.net>
In-Reply-To: <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com>
References:  <AANLkTinfOSQGnk0%2BPK6iM0=v5CZn2vcmJZbA8TvgGbfr@mail.gmail.com> <4C76CA06.5010001@FreeBSD.org> <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/27/2010 05:17, pluknet wrote:
> On 27 August 2010 00:09, Doug Barton <dougb@freebsd.org> wrote:
>> On 08/26/2010 12:53 PM, pluknet wrote:
>>>
>>> [cc'ing current@ as rc@ looks too quite]
>>>
>>> Hi.
>>>
>>> Since ifconfig has grown to label interfaces with
>>> ifconfig $ifname description "foobar", what about
>>> to give it more life and store i/face descriptions
>>> semi-permanently, so they will survive between reboots?
>>>
>>> This patch adds a functionality to rc.d to label
>>> interfaces at boot time.
>>>
>>> Comments are welcome.
>>
>> This seems like a good addition, thanks. Please also write a patch for
>> rc.conf.5 to describe this new functionality and I'll be happy to commit it.
> 
> Xin Li helped me with updating rc.conf.5 (thanks!).
> It's included in attached patch.
> 
>>  One note below.
>>
>>
>>> --- etc/network.subr    (revision 211280)
>>> +++ etc/network.subr    (working copy)
>>> @@ -1187,6 +1187,24 @@
>>>         return 0
>>>  }
>>>
>>> +# ifnet_descr
>>> +#      Add description to all requested interfaces.
>>> +#
>>> +ifnet_descr()
>>> +{
>>> +       local _if _ifdescr
>>> +
>>> +       # ifconfig_IF_descr
>>> +       for _if in `ifconfig -l`; do
>>> +               _ifdescr="`get_if_var $_if ifconfig_IF_descr`"
>>> +               if [ ! -z "$_ifdescr" ]; then
>>
>> This is probably better as [ -n "$_ifdescr" ]
>>
> 
> This was blindly copy&pasted after ifnet_rename().
> So, it makes sense probably to change test expression there as well.
> [see ifnet_rename() proposed change below inline]
> This change to ifnet_rename() is not included in attached patch
> to not complicate things unnecessarily for now.
> 
> Index: etc/network.subr
> ===================================================================
> --- etc/network.subr    (revision 211280)
> +++ etc/network.subr    (working copy)
> @@ -1179,7 +1179,7 @@
>         # ifconfig_IF_name
>         for _if in `ifconfig -l`; do
>                 _ifname=`get_if_var $_if ifconfig_IF_name`
> -               if [ ! -z "$_ifname" ]; then
> +               if [ -n "$_ifname" ]; then
>                         ifconfig $_if name $_ifname
>                 fi
>         done

Was this ever committed ? If so does anyone have any referring svn
revisions ?

Also if this is committed or planned to be committed is there a chance
it could be MFC'd ?

Would be awesome if this was available on a production release without
patching ;)


Thanks in advance,

-- 

 jhell,v



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CB135F5.20804>