From owner-freebsd-stable@FreeBSD.ORG Fri Feb 9 21:49:09 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 C4F4F16A501 for ; Fri, 9 Feb 2007 21:49:09 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [216.148.227.153]) by mx1.freebsd.org (Postfix) with ESMTP id B106E13C4AA for ; Fri, 9 Feb 2007 21:49:09 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from icarus.home.lan (c-71-198-0-135.hsd1.ca.comcast.net[71.198.0.135]) by comcast.net (rwcrmhc13) with ESMTP id <20070209214909m1300spehke>; Fri, 9 Feb 2007 21:49:09 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id DD1621FA01D; Fri, 9 Feb 2007 13:49:08 -0800 (PST) Date: Fri, 9 Feb 2007 13:49:08 -0800 From: Jeremy Chadwick To: Kevin Way Message-ID: <20070209214908.GA64090@icarus.home.lan> Mail-Followup-To: Kevin Way , freebsd-stable@freebsd.org References: <45CCE270.7080704@insidesystems.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45CCE270.7080704@insidesystems.net> X-PGP-Key: http://jdc.parodius.com/pubkey.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-stable@freebsd.org 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: Fri, 09 Feb 2007 21:49:09 -0000 On Fri, Feb 09, 2007 at 04:06:56PM -0500, Kevin Way wrote: > I recently ran into a bug in the jail startup scripts that caused this > command to be executed: > > ifconfig bce0 -alias > > It turns out that this command eliminated the primary IP for the device. > > man ifconfig defines the behavior of -alias to be: > > -alias Remove the network address specified. This would be used > if you > incorrectly specified an alias, or it was no longer needed. If > you have incorrectly set an NS address having the side > effect of > specifying the host portion, removing all NS addresses will > allow > you to respecify the host portion. > > > I can't help but wonder if it would be better behavior to throw an error > when no > argument is supplied. > > The only discussion I found of this in a quick search of the archives > was a post in > 2004 which noted that the fxp driver actually deletes all IP addresses, > but there was > no significant follow-up. > > Should ifconfig throw an error if no address is supplied? My vote is for either 1) an error, or 2) delete all of the aliases associated with that interface. If I had a preference, I'd choose #1. I'd argue that -alias doing what you described (removing the non-aliased IP bound to the iface) when no inet/inet6 arguments are suppied is indeed a bug. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |