From owner-freebsd-stable@FreeBSD.ORG Mon Feb 12 18:41:04 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 4F26A16A421 for ; Mon, 12 Feb 2007 18:41:04 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (grnl-static-02-0046.dsl.iowatelecom.net [69.66.56.110]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF3E13C4A5 for ; Mon, 12 Feb 2007 18:41:03 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.8/8.13.8) with ESMTP id l1CIf28c053300 for ; Mon, 12 Feb 2007 12:41:02 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.8/8.13.8/Submit) id l1CIf2kM053299 for freebsd-stable@FreeBSD.ORG; Mon, 12 Feb 2007 12:41:02 -0600 (CST) (envelope-from brooks) Date: Mon, 12 Feb 2007 12:41:02 -0600 From: Brooks Davis To: freebsd-stable@FreeBSD.ORG Message-ID: <20070212184102.GD52751@lor.one-eyed-alien.net> References: <20070212175940.GA52751@lor.one-eyed-alien.net> <200702121823.l1CINXHt066223@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZJcv+A0YCCLh2VIg" Content-Disposition: inline In-Reply-To: <200702121823.l1CINXHt066223@lurza.secnetix.de> User-Agent: Mutt/1.5.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 12 Feb 2007 12:41:02 -0600 (CST) Cc: Subject: Re: Desired behaviour of "ifconfig -alias" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 18:41:04 -0000 --ZJcv+A0YCCLh2VIg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2007 at 07:23:33PM +0100, Oliver Fromme wrote: > Brooks Davis wrote: > > Oliver Fromme wrote: > > > Brooks Davis wrote: > > > > ipv4_addrs_ is a much better replacement IMO. It's eas= y to > > > > use and doesn't required the hackish pseudo array traversal used by > > > > ifconfig_iface_aliasX. > > >=20 > > > That might work for simple cases, but how do you specify > > > other parameters beside the IPs if you need to? > >=20 > > What do you need to set? It's sets IP and netmask. It doesn't handle > > broadcast, but I'd be pretty suprised if that's needed often. >=20 > True, not often, but sometimes. I had cases like that in > certain environments with bridged networks and arp proxies. >=20 > 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. We might want to add a feature to set the broadcast address. > > is needed? Axing ifconfig_iface_aliasX is not needed, but reducing the > > visiability of the interface in the documentation is probably in order > > particularly since it's quite fragile since you have to renumber whene= ver > > you remove an entry. >=20 > 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: >=20 > set | grep "^ifconfig_${IFACE}_alias" | cut -f1 -d=3D | ... Unfortuanly grep in in /usr/bin so can't be used. You could do it with sh variable mangling and case though. Something like: { while read _var; do _var=3D${_var%%=3D*} case $_var in ifconfig_${IFACE}_alias*) <...> ;; esac done } < `set` -- Brooks --ZJcv+A0YCCLh2VIg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF0LS9XY6L6fI4GtQRAmTMAJ4i6Kn/2sSX5UaFvL/l8mElJqiuJgCgo7hT 6pL0dAqXf9N+WoIupWMkyG0= =x8h1 -----END PGP SIGNATURE----- --ZJcv+A0YCCLh2VIg--