From owner-freebsd-stable@FreeBSD.ORG Mon Feb 12 22:05:05 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 512DA16A406; Mon, 12 Feb 2007 22:05:05 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id B8FCA13C4A8; Mon, 12 Feb 2007 22:05:04 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (xeryjg@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l1CM4vED089637; Mon, 12 Feb 2007 23:05:03 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l1CM4vBb089636; Mon, 12 Feb 2007 23:04:57 +0100 (CET) (envelope-from olli) Date: Mon, 12 Feb 2007 23:04:57 +0100 (CET) Message-Id: <200702122204.l1CM4vBb089636@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, brooks@FreeBSD.ORG In-Reply-To: <20070212184102.GD52751@lor.one-eyed-alien.net> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 12 Feb 2007 23:05:03 +0100 (CET) Cc: Subject: Re: Desired behaviour of "ifconfig -alias" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, brooks@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2007 22:05:05 -0000 Brooks Davis wrote: > Oliver Fromme wrote: > > True, not often, but sometimes. I had cases like that in > > certain environments with bridged networks and arp proxies. > > > > I'm fine with your proposed syntax, as long as all the > > existing ifconfig possibilities continue to be possible, > > i.e. no regression. > > FWIW, it's HEAD and 6.1. We've actually got the aliases syntax labled > as deprecated in the manpage. Interesting, I wasn't aware of that. I'll update my rc.conf where possible. > We might want to add a feature to set the > broadcast address. Yes. > > Yup, I agree, that's a PITA. That could be solved in the > > shell code, though, by not enumerating until a number > > doesn't exist, but instead looking at the set of all > > shell variables that have been set, similar to this: > > > > set | grep "^ifconfig_${IFACE}_alias" | cut -f1 -d= | ... > > Unfortuanly grep in in /usr/bin so can't be used. Well, ed is in /bin and can be used as a replacement for grep; the syntax is just a little more awkward. Or use the common IFS trick: OLD_IFS="$IFS" IFS="=" set | while read VAR VALUE; do case "$VAR" in ifconfig_${IFACE}_alias*) ... ;; esac done IFS="$OLD_IFS" > { while read _var; do > _var=${_var%%=*} > case $_var in > ifconfig_${IFACE}_alias*) > <...> > ;; > esac > done } < `set` Yup, that would work, too, except that you have to write "set | while read _var; do ...". The "< `set`" will not work. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, USt-Id: DE204219783 Any opinions expressed in this message are personal to the author and may not necessarily reflect the opinions of secnetix GmbH & Co KG in any way. FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "When your hammer is C++, everything begins to look like a thumb." -- Steve Haflich, in comp.lang.c++