From owner-freebsd-current@FreeBSD.ORG Thu Aug 26 21:10:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ECAF1065673 for ; Thu, 26 Aug 2010 21:10:16 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id D8D2A8FC17 for ; Thu, 26 Aug 2010 21:10:15 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 63219A600ED; Fri, 27 Aug 2010 05:10:14 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id zm-K9vSFijQ4; Fri, 27 Aug 2010 05:10:04 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id C8227A5FDBE; Fri, 27 Aug 2010 05:10:01 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:references:in-reply-to:x-enigmail-version:openpgp:content-type; b=KTiX7fNPyJI8hXRdKWrxdMoOXQxTcuyDk8JcBmTOv6Lht9Mk+IW2uVDawCy7AMJE6 ppX3CJJ6uPACTlrR1MXow== Message-ID: <4C76D823.7070703@delphij.net> Date: Thu, 26 Aug 2010 14:09:55 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100721 Thunderbird/3.0.6 ThunderBrowse/3.3.2 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4C76CA06.5010001@FreeBSD.org> In-Reply-To: <4C76CA06.5010001@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------020709080901060207010303" Subject: Re: [RFC] ifconfig description support in rc.d X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 21:10:16 -0000 This is a multi-part message in MIME format. --------------020709080901060207010303 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/08/26 13: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. One note below. I have drafted one. (Note that fxp is a 100Mbps card so it might be sensible to replace it with just Switch 2?) >> --- 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 > - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJMdtgjAAoJEATO+BI/yjfBywEIALQZMUFUKlkQ/DZjrqBgymFx Mnj6YkLaPXcvNI5OI15Q3hy730pIZzzNPGKV9ecXLSQ1PikZUIXy5fuRfYh9iXE3 d9f4UgDId0Sn55WmD6/Sfza0oSlH3C1fus6e9NSmm/aR3ekWyLWZzW0wGTgEXFxK bo0ZcQw7AxRxDLc7EifWUfxV/Ej5pga5YjVyhBBdCoAHl2bPJuFFuxd140Y6+Mlf gH4zgf2rdGpCWNpWF6L8PsGoVNBoK0R1fUwJZT+GB2ANvMuuQ+jsks+R8h8XFIO6 TE4O8onVcOaoTGZ3873M3CqcO1jfaK5rBfGg3Cr9wUjOkvkQ8SL+k4uvBm4CuX4= =VtCo -----END PGP SIGNATURE----- --------------020709080901060207010303 Content-Type: text/plain; name="rc.conf.5-ifdescr.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="rc.conf.5-ifdescr.diff" SW5kZXg6IHJjLmNvbmYuNQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSByYy5jb25mLjUJKHJldmlzaW9u IDIxMTg0NykKKysrIHJjLmNvbmYuNQkod29ya2luZyBjb3B5KQpAQCAtMTEyOCw2ICsxMTI4 LDE5IEBACiB2YXJpYWJsZXMuCiAuUHAKIElmIGEKKy5WYSBpZmNvbmZpZ18gTnMgQW8gQXIg aW50ZXJmYWNlIEFjIE5zIFZhIF9kZXNjcgordmFyaWFibGUgaXMgc2V0LCB0aGUgaW50ZXJm YWNlIHdvdWxkIGJlIGFzc2lnbmVkIHRoZSBkZXNjcmlwdGlvbgorc3BlY2lmaWVkIGJ5IHRo ZSB2YXJpYWJsZS4KKy5QcAorVG8gYXNzaWduIGFuIGRlc2NyaXB0aW9uIG9mCisuRHEgVXBs aW5rIHRvIEdpZ2FiaXQgU3dpdGNoIDEKK29uIHRoZSBpbnRlcmZhY2UgbmFtZWQKKy5MaSBl bTAgOgorLkJkIC1saXRlcmFsCitpZmNvbmZpZ19lbTBfZGVzY3I9IlVwbGluayB0byBHaWdh Yml0IFN3aXRjaCAxIgorLkVkCisuUHAKK0lmIGEKIC5WYSB2bGFuc18gTnMgQXEgQXIgaW50 ZXJmYWNlCiB2YXJpYWJsZSBpcyBzZXQsCiBhCg== --------------020709080901060207010303--