Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2005 18:40:23 +0200
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        rc@freebsd.org
Subject:   ifconfig_foo0 syntax
Message-ID:  <86ll0d4mtk.fsf@xps.des.no>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
I've been having trouble with a bridge interface.  It seemed logical
to me to do

cloned_interfaces="bridge0"
ifconfig_bridge0="addm foo0 addm bar0 inet 10.0.0.1/24"

but ifconfig(8) does not accept "inet" after "addm".

(perhaps I should have put the inet bit at the front?)

In any case, I came up with a patch that allows me to do

ifconfig_bridge0="addm foo0; addm bar0; inet 10.0.0.1/24"

which translates into three different ifconfig invocations.

there's probably a better / cleaner way to do this...

DES
-- 
Dag-Erling Smørgrav - des@des.no


[-- Attachment #2 --]
Index: etc/network.subr
===================================================================
RCS file: /home/ncvs/src/etc/network.subr,v
retrieving revision 1.167
diff -u -r1.167 network.subr
--- etc/network.subr	2 Sep 2005 17:11:13 -0000	1.167
+++ etc/network.subr	1 Jan 2002 18:24:17 -0000
@@ -44,7 +44,12 @@
 	ifconfig_args=`ifconfig_getargs $1`
 	if [ -n "${ifconfig_args}" ]; then
 		ifconfig $1 up
-		eval "ifconfig $1 ${ifconfig_args}"
+		while :; do
+			_args="${ifconfig_args%%;*}"
+			eval "ifconfig $1 ${_args}"
+			ifconfig_args="${ifconfig_args#*;}"
+			[ "${_args}" = "${ifconfig_args}" ] && break
+		done
 		_cfg=0
 	fi
 

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ll0d4mtk.fsf>