Re: [RFC] ifconfig description support in rc.d

From: Doug Barton <dougb_at_FreeBSD.org>
Date: Thu, 26 Aug 2010 13:09:42 -0700
On 08/26/2010 12:53 PM, pluknet wrote:
> [cc'ing current_at_ as rc_at_ 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.  One note below.


> --- etc/network.subr    (revision 211280)
> +++ etc/network.subr    (working copy)
> _at__at_ -1187,6 +1187,24 _at__at_
>          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" ]

Doug

-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

	Computers are useless. They can only give you answers.
			-- Pablo Picasso
Received on Thu Aug 26 2010 - 18:09:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC