From owner-freebsd-rc@FreeBSD.ORG Fri Oct 28 16:40:30 2005 Return-Path: X-Original-To: rc@freebsd.org Delivered-To: freebsd-rc@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E95216A44D for ; Fri, 28 Oct 2005 16:40:30 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id C35E443D45 for ; Fri, 28 Oct 2005 16:40:29 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 3988A2384 for ; Fri, 28 Oct 2005 18:40:24 +0200 (CEST) X-Spam-Tests: ALL_TRUSTED,AWL,BAYES_00 X-Spam-Learn: ham X-Spam-Score: -4.4/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on tim.des.no Received: from xps.des.no (des.no [80.203.228.37]) by tim.des.no (Postfix) with ESMTP id BCFA12383 for ; Fri, 28 Oct 2005 18:40:23 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 90A9E33C21; Fri, 28 Oct 2005 18:40:23 +0200 (CEST) To: rc@freebsd.org From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Fri, 28 Oct 2005 18:40:23 +0200 Message-ID: <86ll0d4mtk.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: ifconfig_foo0 syntax X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 16:40:30 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I've been having trouble with a bridge interface. It seemed logical to me to do cloned_interfaces=3D"bridge0" ifconfig_bridge0=3D"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=3D"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 --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=network_subr.diff 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 --=-=-=--