Subject: bin/30694: ifconfig(8) brings the interface up when assigning an IP, even when "down" is also specified
To: None <email@example.com, firstname.lastname@example.org>
From: None <email@example.com>
Date: 07/08/2005 12:27:00
>Synopsis: ifconfig(8) brings the interface up when assigning an IP, even when "down" is also specified
>Arrival-Date: Fri Jul 08 12:27:00 +0000 2005
>Originator: Christian Hattemer
NetBSD lahksa 3.0_BETA NetBSD 3.0_BETA (SPARC-TEST) #0: Wed Jun 15 16:21:50 CEST 2005
Sometimes you want to configure an interface completly including assigning an IP, but keep it down. E. g. prepare a pppoe interface to go up on demand later.
But it will always go up when assigning the IP and ignore the "down" parameter.
It turns out that ifconfig pretends to work as expected in 2.0. However it archives that by setting the interface down again after it has come up. Since this isn't the correct way this code was removed again shortly after 2.0 was branched.
See Rev. 1.142 of src/sbin/ifconfig/ifconfig.c for that.
PS: I'm going on vacation for two weeks this afternoon.
# ifconfig le0
le0: flags=8862<BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
media: Ethernet autoselect
# ifconfig le0 192.168.5.5 down
# ifconfig le0
le0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
media: Ethernet autoselect (10baseT)
inet 192.168.5.5 netmask 0xffffff00 broadcast 192.168.5.255
As that log message of the above mentioned revision states:
"If we don't want the kernel to automatically bring up interfaces, then we should move that code into ifconfig(8) and out of the kernel, not cycle the interface up and down."