From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 27 11:40:10 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38D6D1065675 for ; Wed, 27 Apr 2011 11:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 136508FC12 for ; Wed, 27 Apr 2011 11:40:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RBe9tc003546 for ; Wed, 27 Apr 2011 11:40:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3RBe9IA003545; Wed, 27 Apr 2011 11:40:09 GMT (envelope-from gnats) Resent-Date: Wed, 27 Apr 2011 11:40:09 GMT Resent-Message-Id: <201104271140.p3RBe9IA003545@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alexander V. Chernikov" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2316B1065672 for ; Wed, 27 Apr 2011 11:37:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 109908FC19 for ; Wed, 27 Apr 2011 11:37:19 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RBbIuU047337 for ; Wed, 27 Apr 2011 11:37:18 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p3RBbI1C047336; Wed, 27 Apr 2011 11:37:18 GMT (envelope-from nobody) Message-Id: <201104271137.p3RBbI1C047336@red.freebsd.org> Date: Wed, 27 Apr 2011 11:37:18 GMT From: "Alexander V. Chernikov" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/156675: [patch] add ifconfig_IF_description variable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2011 11:40:10 -0000 >Number: 156675 >Category: conf >Synopsis: [patch] add ifconfig_IF_description variable >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 27 11:40:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Alexander V. Chernikov >Release: FreeBSD 8.2-STABLE >Organization: JSC "Meganet" >Environment: FreeBSD silicium.meganet.ru 8.2-STABLE FreeBSD 8.2-STABLE #1: Mon Apr 18 18:22:06 MSD 2011 root@silicium.meganet.ru:/usr/obj/usr/src/sys/ROUTER amd64 >Description: Since 8.X it is possible to network interface description via ifconfig vlanX description my long description Setting such description (any data with spaces) via ifconfig_IF=".. description 'my long description' ..." resuls in setting description "my" (e.g. data before first space) Various common escaping ('', \ , \"\") does not help >How-To-Repeat: echo ifconfig_vlan555=\"description \'1 2 3\' vlan 255 vlandev IFACE\" >> /etc/rc.conf ifconfig vlan555 create ifconfig >Fix: Proposed solution is to add new ifconfig_IF_description rc.conf variable Patch attached with submission follows: --- etc/network.subr.orig 2011-04-27 13:15:24.125829072 +0400 +++ etc/network.subr 2011-04-27 13:44:36.713516613 +0400 @@ -90,6 +90,12 @@ _cfg=0 fi + # set interface description + description=`get_if_var $1 ifconfig_IF_description` + if [ -n "${description}" ]; then + ifconfig $1 description "${description}" + fi + if wpaif $1; then /etc/rc.d/wpa_supplicant start $1 _cfg=0 # XXX: not sure this should count --- share/man/man5/rc.conf.5.orig 2011-01-24 18:17:10.000000000 +0300 +++ share/man/man5/rc.conf.5 2011-04-27 14:16:08.508775228 +0400 @@ -1078,6 +1078,10 @@ .Xr ifconfig 8 while the order of the other arguments is preserved. .Pp +Interface description can be set via +.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _description +variable +.Pp One can configure more than one IPv4 address with the .Va ipv4_addrs_ Ns Aq Ar interface variable. >Release-Note: >Audit-Trail: >Unformatted: