Bug 156675 - [network.subr] [patch] add ifconfig_IF_description variable
Summary: [network.subr] [patch] add ifconfig_IF_description variable
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey Kandaurov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-27 12:40 UTC by Alexander V. Chernikov
Modified: 2011-07-08 08:40 UTC (History)
0 users

See Also:


Attachments
file.diff (870 bytes, patch)
2011-04-27 12:40 UTC, Alexander V. Chernikov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander V. Chernikov 2011-04-27 12:40:09 UTC
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

Fix: Proposed solution is to add new ifconfig_IF_description rc.conf variable

Patch attached with submission follows:
How-To-Repeat: echo ifconfig_vlan555=\"description \'1 2 3\' vlan 255 vlandev IFACE\" >> /etc/rc.conf
ifconfig vlan555 create
ifconfig
Comment 1 jhell 2011-04-28 13:58:49 UTC
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.

-- 

 Regards, (jhell)
 Jason Hellenthal
Comment 2 Sergey Kandaurov freebsd_committer freebsd_triage 2011-06-24 15:57:04 UTC
Responsible Changed
From-To: freebsd-bugs->pluknet

Take this PR.
Comment 3 dfilter service freebsd_committer freebsd_triage 2011-06-24 15:57:18 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"
Comment 4 Sergey Kandaurov freebsd_committer freebsd_triage 2011-07-08 08:38:59 UTC
State Changed
From-To: open->closed

Merged.
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-07-08 08:39:05 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"