From nobody@FreeBSD.org  Wed Apr 27 11:37:19 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2316B1065672
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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" <melifaro@ipfw.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] add ifconfig_IF_description variable
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         156675
>Category:       conf
>Synopsis:       [network.subr] [patch] add ifconfig_IF_description variable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pluknet
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 27 11:40:09 UTC 2011
>Closed-Date:    Fri Jul 08 07:39:42 UTC 2011
>Last-Modified:  Fri Jul  8 07:40:02 UTC 2011
>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' ..." results 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:

From: "Jason J. Hellenthal" <jhell@DataIX.net>
To: "Alexander V. Chernikov" <melifaro@ipfw.ru>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/156675: [patch] add ifconfig_IF_description variable
Date: Thu, 28 Apr 2011 08:58:49 -0400

 --qMm9M+Fa2AknHoGS
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 
 Conceringing conf/156675
 
 Alexander, Current@,
 
 Conversation started here,
 http://www.mail-archive.com/freebsd-current@freebsd.org/msg124513.html
 
 Apparently the testing & review period for this patch has long past with
 no results. I ran this patch for quite some time with no trouble for
 such a simple change.
 
 Please commit the attached URL or a modification of it.
 
 
 current@ BCC'd since this is where the conversation happened.
 
 --=20
 
  Regards, (jhell)
  Jason Hellenthal
 
 
 --qMm9M+Fa2AknHoGS
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (FreeBSD)
 Comment: http://bit.ly/0x89D8547E
 
 iQEcBAEBAgAGBQJNuWSIAAoJEJBXh4mJ2FR+ozMH/Aw9XbDJHhGDBSQhriLhGtfi
 64P8KE7/Fj1WqT0whpf5OnFDt8+b4JEsjLUGs6P4pRGQjVs+mAokxfcBxHx1l/x8
 THnbflZRDI3pF9D5GA22H9vyg4gjMlo2+qw3aTQZAnseZDV+rxPAvAb5e3JSoj5H
 VgIIeM1pU5rFHvGNsQvv2Da68mJqcsWHHAG2OoL/j7x4t94TmD4QS0UobZnv1m3Y
 Sos8yhqgK0pa3B/oKdR8uounPJ0Fz6UMWRO9k/c0QVVLwe1B9Y7R1Qrsp4MhtlFf
 xNwQ2vr1bQ5W6mSmC48e/dOaFFN5y7P5WomGlw7g5dMljeOFwuKoBxArGgGr/Mk=
 =DJN0
 -----END PGP SIGNATURE-----
 
 --qMm9M+Fa2AknHoGS--
Responsible-Changed-From-To: freebsd-bugs->pluknet 
Responsible-Changed-By: pluknet 
Responsible-Changed-When: Fri Jun 24 14:57:04 UTC 2011 
Responsible-Changed-Why:  
Take this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156675 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/156675: commit references a PR
Date: Fri, 24 Jun 2011 14:57:18 +0000 (UTC)

 Author: pluknet
 Date: Fri Jun 24 14:56:38 2011
 New Revision: 223506
 URL: http://svn.freebsd.org/changeset/base/223506
 
 Log:
   Add support for string values with white spaces for ifconfig(8)
   parameters accepting them (such as description, group).
   
   Changes discussed on freebsd-rc.
   
   PR:		conf/156675
   Reported by:	"Alexander V. Chernikov" <melifaro att ipfw ru>
   Suggested by:	hrs
   Analyzed with:	Alexander V. Chernikov via IRC
   MFC after:	2 weeks
 
 Modified:
   head/etc/network.subr
 
 Modified: head/etc/network.subr
 ==============================================================================
 --- head/etc/network.subr	Fri Jun 24 14:40:22 2011	(r223505)
 +++ head/etc/network.subr	Fri Jun 24 14:56:38 2011	(r223506)
 @@ -94,7 +94,7 @@ ifconfig_up()
  	# ifconfig_IF
  	ifconfig_args=`ifconfig_getargs $1`
  	if [ -n "${ifconfig_args}" ]; then
 -		ifconfig $1 ${ifconfig_args}
 +		eval ifconfig $1 ${ifconfig_args}
  		_cfg=0
  	fi
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: pluknet 
State-Changed-When: Fri Jul 8 07:38:59 UTC 2011 
State-Changed-Why:  
Merged. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156675 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/156675: commit references a PR
Date: Fri,  8 Jul 2011 07:39:05 +0000 (UTC)

 Author: pluknet
 Date: Fri Jul  8 07:38:45 2011
 New Revision: 223858
 URL: http://svn.freebsd.org/changeset/base/223858
 
 Log:
   MFC r223506:
   
    Add support for string values with white spaces for ifconfig(8)
    parameters accepting them (such as description, group).
   
   PR:		conf/156675
 
 Modified:
   stable/8/etc/network.subr
 Directory Properties:
   stable/8/etc/   (props changed)
 
 Modified: stable/8/etc/network.subr
 ==============================================================================
 --- stable/8/etc/network.subr	Fri Jul  8 06:28:35 2011	(r223857)
 +++ stable/8/etc/network.subr	Fri Jul  8 07:38:45 2011	(r223858)
 @@ -85,7 +85,7 @@ ifconfig_up()
  
  	ifconfig_args=`ifconfig_getargs $1`
  	if [ -n "${ifconfig_args}" ]; then
 -		ifconfig $1 ${ifconfig_args}
 +		eval ifconfig $1 ${ifconfig_args}
  		ifconfig $1 up
  		_cfg=0
  	fi
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
