From owner-freebsd-stable@FreeBSD.ORG Mon Feb 12 14:26:26 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 986AD16A400 for ; Mon, 12 Feb 2007 14:26:26 +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 17B2213C428 for ; Mon, 12 Feb 2007 14:26:25 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (jividq@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l1CEQJ6M031565; Mon, 12 Feb 2007 15:26:24 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l1CEQIF4031564; Mon, 12 Feb 2007 15:26:18 +0100 (CET) (envelope-from olli) Date: Mon, 12 Feb 2007 15:26:18 +0100 (CET) Message-Id: <200702121426.l1CEQIF4031564@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, kevin@insidesystems.net, brooks@FreeBSD.ORG, joao@matik.com.br In-Reply-To: <200702092300.35420.joao@matik.com.br> 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 15:26:24 +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, kevin@insidesystems.net, brooks@FreeBSD.ORG, joao@matik.com.br 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 14:26:26 -0000 JoaoBR wrote: > Brooks Davis wrote: > > Jeremy Chadwick wrote: > > > 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. > > > > > .... > > > > It's way to late to make this change. This is known behavior and has > > been for ages. If there's a bug it's in the documentation. > > wellwell, we also were apes for ages but does not mean that we stay behaving > like them and if some still does so it is also never to late to change > that ;) Changing the behaviour of tools always involves a certain danegr of breaking existing script. That's especially true for symstem administration commands such as ifconfig that are running in automated scripts, and people depend on them for booting their machines remotely. I'm not saying that people are intentionally using that syntax ... Maybe they are, maybe not. But you also should take into accounts that there might be scripts that use the syntax inadvertantly and happen to work correctly because of the current behaviour. I'm also _not_ saying that the behaviour must not be changed at all. But it should be done carefully, i.e. first to -current, with proper "heads up" warnings. Don't change it in RELENG_6 without warning and expect evrybody to be happy. > "ifconfig nic -alias" is obviously a wired and confusing behaviour It might be confusing to you. Personally I think that the current behaviour isn't that far off. First you need to be aware that there is no distinction between a primary IP and alias IPs (such a distinction existed historically, but it's gone). All of the IPs on an interface are equal, just like hardlinks on a file. Maybe the manual page should be clearer about that. The "-alias" parameter simply removes an address from an interface. The term "alias" should really be avoided because it is misleading. You can use "delete" or "remove" which do the same thing. I think "-alias" should really be regarded to exist for backwards compatibility only. Personally I always use "delete". If no IP address is specified, then it's not completely nonsensical to remove the first address. In fact I've used that short-cut to quickly remove the only address from an interface. I've used "ifconfig xyz0 delete" quite a lot. > then already beeing here there is more, ifconfig nic alias does not return > anything at all That's the same as "ifconfig nic add". If you don't tell it anything to add, then it won't add anything, of course. Remember that UNIX always tries to do exactly what you tell it to dao. ;-) > and ifconfig nic -alias on a nic w/o ip returns "can't assign > requested address" ... That error corresponds to EADDRNOTAVAIL, which is the correct errno to return, because there's no address left on the interface. However, I agree that the message is a bit confusing to the unfamiliar. 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 I suggested holding a "Python Object Oriented Programming Seminar", but the acronym was unpopular. -- Joseph Strout