atom feed57 messages in org.freebsd.freebsd-stableDesired behaviour of "ifconfig -alias"
FromSent OnAttachments
Kevin WayFeb 9, 2007 9:35 pm 
Jeremy ChadwickFeb 9, 2007 9:48 pm 
Brooks DavisFeb 9, 2007 10:54 pm 
JoaoBRFeb 10, 2007 1:00 am 
Kevin WayFeb 10, 2007 2:13 am 
Jeremy ChadwickFeb 10, 2007 2:47 am 
Ian SmithFeb 10, 2007 5:12 am 
JoaoBRFeb 10, 2007 10:16 am 
Michael NottebrockFeb 10, 2007 12:15 pm 
Ian SmithFeb 10, 2007 2:19 pm 
Bruce M. SimpsonFeb 11, 2007 1:35 am 
Oliver FrommeFeb 12, 2007 2:26 pm 
Brooks DavisFeb 12, 2007 2:42 pm 
Jeremy ChadwickFeb 12, 2007 3:36 pm 
Oliver FrommeFeb 12, 2007 4:22 pm 
Brooks DavisFeb 12, 2007 4:36 pm 
JoaoBRFeb 12, 2007 5:27 pm 
Oliver FrommeFeb 12, 2007 5:39 pm 
Brooks DavisFeb 12, 2007 5:59 pm 
Oliver FrommeFeb 12, 2007 6:09 pm 
Oliver FrommeFeb 12, 2007 6:23 pm 
Brooks DavisFeb 12, 2007 6:40 pm 
Jeremy ChadwickFeb 12, 2007 7:16 pm 
Brooks DavisFeb 12, 2007 7:27 pm 
John HayFeb 12, 2007 7:32 pm 
Jeremy ChadwickFeb 12, 2007 7:34 pm 
Brooks DavisFeb 12, 2007 7:43 pm 
Freddie CashFeb 12, 2007 7:47 pm 
JoaoBRFeb 12, 2007 7:54 pm 
JoaoBRFeb 12, 2007 9:17 pm 
Oliver FrommeFeb 12, 2007 10:04 pm 
J. T. FarmerFeb 12, 2007 11:14 pm 
Kevin WayFeb 12, 2007 11:26 pm 
Joerg PernfussFeb 13, 2007 2:01 am 
Brooks DavisFeb 13, 2007 2:23 am 
Sam LefflerFeb 13, 2007 4:00 am 
Freddie CashFeb 13, 2007 6:08 am 
JoaoBRFeb 13, 2007 7:43 am 
Oliver FrommeFeb 13, 2007 7:57 am 
JoaoBRFeb 13, 2007 8:52 am 
Oliver FrommeFeb 13, 2007 10:38 am 
Oliver FrommeFeb 13, 2007 10:47 am 
Bruce M. SimpsonFeb 13, 2007 1:17 pm 
Freddie CashFeb 13, 2007 5:14 pm 
Pete FrenchFeb 13, 2007 5:19 pm 
Freddie CashFeb 13, 2007 5:22 pm 
Freddie CashFeb 13, 2007 5:44 pm 
Jeremy ChadwickFeb 13, 2007 6:08 pm 
Oliver FrommeFeb 13, 2007 6:37 pm 
Oliver FrommeFeb 13, 2007 6:41 pm 
Freddie CashFeb 13, 2007 6:55 pm 
sth...@nethelp.noFeb 13, 2007 7:02 pm 
Joan Picanyol i PuigFeb 13, 2007 7:04 pm 
Patrick M. HausenFeb 13, 2007 7:10 pm 
Oliver FrommeFeb 13, 2007 8:06 pm 
Oliver FrommeFeb 13, 2007 8:36 pm 
Jeremy ChadwickFeb 13, 2007 9:32 pm 
Subject:Desired behaviour of "ifconfig -alias"
From:Oliver Fromme (ol@lurza.secnetix.de)
Date:Feb 12, 2007 2:26:11 pm
List:org.freebsd.freebsd-stable

JoaoBR <jo@matik.com.br> wrote:

Brooks Davis wrote:

Jeremy Chadwick 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

I suggested holding a "Python Object Oriented Programming Seminar", but the acronym was unpopular. -- Joseph Strout