From owner-freebsd-rc@FreeBSD.ORG Sun Oct 10 04:05:22 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 EE8F11065673 for ; Sun, 10 Oct 2010 04:05:21 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB218FC0A for ; Sun, 10 Oct 2010 04:05:21 +0000 (UTC) Received: by ywh2 with SMTP id 2so456359ywh.13 for ; Sat, 09 Oct 2010 21:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=hjTy1wQlDKdLEW8lPlR6s1kZE9AuVSruc9raenrfxrw=; b=vSUWMT2gwba53YnGLOipetnfahgPDy7hJSeedVPMkEp73YX9v4yXbiDojc72SSUlwI IhwEuvSTE+PaLE4ptZ0frFnFSdPH7ovyCicRAGXWfSqeQH78TBtHeuZpK+yqjU+I/8TT nKzn7CAFUmHymgNz5WVOTSslBCD//mCBikOHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=Gsm8HlUSlJFnSykdQMZ8SGfRteKE2LaaeWxTce34Oyo2KTyT/IUNy69zNYMCGqWKpl H+lmCIQ3oU7U0yctEWpBdaYTvTQuOBCp/QcBxoekhwki3Vds9jLjcmuv6VLO+Z2mixIV v4/2WdwdVSe3Vqyrp6+gRJ0yTM66G+/JN2siY= Received: by 10.150.201.18 with SMTP id y18mr5049945ybf.329.1286682106252; Sat, 09 Oct 2010 20:41:46 -0700 (PDT) Received: from centel.dataix.local ([99.181.144.115]) by mx.google.com with ESMTPS id v9sm4519174yba.3.2010.10.09.20.41.43 (version=SSLv3 cipher=RC4-MD5); Sat, 09 Oct 2010 20:41:44 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4CB135F5.20804@DataIX.net> Date: Sat, 09 Oct 2010 23:41:41 -0400 From: jhell Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100917 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: pluknet References: <4C76CA06.5010001@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Doug Barton , freebsd-rc@freebsd.org, FreeBSD Current 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: Sun, 10 Oct 2010 04:05:22 -0000 On 08/27/2010 05:17, pluknet wrote: > On 27 August 2010 00:09, Doug Barton 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