From owner-freebsd-rc@FreeBSD.ORG Thu Aug 26 20:36:25 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B35A1065694 for ; Thu, 26 Aug 2010 20:36:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9DCE88FC1F for ; Thu, 26 Aug 2010 20:36:24 +0000 (UTC) Received: (qmail 13043 invoked by uid 399); 26 Aug 2010 20:09:43 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Aug 2010 20:09:43 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C76CA06.5010001@FreeBSD.org> Date: Thu, 26 Aug 2010 13:09:42 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: pluknet References: In-Reply-To: X-Enigmail-Version: 1.1.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Current , freebsd-rc@freebsd.org Subject: Re: [RFC] ifconfig description support in rc.d X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 20:36:25 -0000 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. 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" ] 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