From owner-freebsd-stable@FreeBSD.ORG Tue Feb 13 18:09:11 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 3106316A400 for ; Tue, 13 Feb 2007 18:09:11 +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 2534913C48E for ; Tue, 13 Feb 2007 18:09:11 +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 <20070213180910m1300ss6hte>; Tue, 13 Feb 2007 18:09:10 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 3D0FF1FA01D; Tue, 13 Feb 2007 10:09:10 -0800 (PST) Date: Tue, 13 Feb 2007 10:09:10 -0800 From: Jeremy Chadwick To: Pete French Message-ID: <20070213180910.GA69270@icarus.home.lan> Mail-Followup-To: Pete French , freebsd-stable@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Tue, 13 Feb 2007 18:09:11 -0000 On Tue, Feb 13, 2007 at 05:19:59PM +0000, Pete French wrote: > > For a set of IPs in the same subnet on the same interface, wouldn't the > > primary IP be the one with the proper netmask, and all IPs with netmasks > > of /32 be secondary? In that situation, wouldn't deleting the primary IP > > cause connection issues for the rest of the IPs? > > Indeed. I too am not convinced by the 'there is no such thing as a > primary IP address' thing either - because it's trivial to observe > that if you add several addresses to an interface and make outgoing > connections then one of those (the one with the correct netmask) is > always the one used as the source address. Which looks suspiciously like > a primary IP address to me - or at least one which is being treated > slightly differently to all the others on that interface anyway. I agree. I consider the "primary IP" the first (non-aliased) IP bound to the interface. This is the same IP used by default if no particular IP address is explicitly populated sockaddr_in.sin_addr.s_addr during bind(2). I think most system administrators consider a "primary IP" the same thing I do. The underlying API probably does not differentiate any of them (although the routing table seems to differentiate aliases from the "primary IP"; look at netstat -rn), but underlying socket calls probably pick the first entry in the "address index table" per interface when one is not defined, probably based on the routing table too. -- | 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 |