Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Oct 2010 10:29:40 +0400
From:      Sergey Kandaurov <pluknet@gmail.com>
To:        jhell <jhell@dataix.net>
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:  <AANLkTik77T2xjB2Gcmbh4z0EPu-%2BaQ1qwyKoQhGkHZPf@mail.gmail.com>
In-Reply-To: <4CB135F5.20804@DataIX.net>
References:  <AANLkTinfOSQGnk0%2BPK6iM0=v5CZn2vcmJZbA8TvgGbfr@mail.gmail.com> <4C76CA06.5010001@FreeBSD.org> <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com> <4CB135F5.20804@DataIX.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10 October 2010 07:41, jhell <jhell@dataix.net> wrote:
> 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 commi=
t it.
>>
>> Xin Li helped me with updating rc.conf.5 (thanks!).
>> It's included in attached patch.
>>
>>> =A0One note below.
>>>
>>>
>>>> --- etc/network.subr =A0 =A0(revision 211280)
>>>> +++ etc/network.subr =A0 =A0(working copy)
>>>> @@ -1187,6 +1187,24 @@
>>>> =A0 =A0 =A0 =A0 return 0
>>>> =A0}
>>>>
>>>> +# ifnet_descr
>>>> +# =A0 =A0 =A0Add description to all requested interfaces.
>>>> +#
>>>> +ifnet_descr()
>>>> +{
>>>> + =A0 =A0 =A0 local _if _ifdescr
>>>> +
>>>> + =A0 =A0 =A0 # ifconfig_IF_descr
>>>> + =A0 =A0 =A0 for _if in `ifconfig -l`; do
>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 _ifdescr=3D"`get_if_var $_if ifconfig_IF=
_descr`"
>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 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
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> --- etc/network.subr =A0 =A0(revision 211280)
>> +++ etc/network.subr =A0 =A0(working copy)
>> @@ -1179,7 +1179,7 @@
>> =A0 =A0 =A0 =A0 # ifconfig_IF_name
>> =A0 =A0 =A0 =A0 for _if in `ifconfig -l`; do
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 _ifname=3D`get_if_var $_if ifconfig_IF_n=
ame`
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ ! -z "$_ifname" ]; then
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ -n "$_ifname" ]; then
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifconfig $_if name $_ifn=
ame
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fi
>> =A0 =A0 =A0 =A0 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 ;)
>

Hi.

I'm going to commit this after a proper review.

--=20
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik77T2xjB2Gcmbh4z0EPu-%2BaQ1qwyKoQhGkHZPf>