ifconfig: ioctl (SIOCAIFADDR): File exists - but not only with alias command

Raimundo Santos raitech at gmail.com
Wed Oct 16 19:14:15 UTC 2013


On 16 October 2013 15:54, Alan Somers <asomers at freebsd.org> wrote:

>
>
> I ran into the same problem, on a system with LAGGs, multiple FIBs and
> multiple aliases per interface.  I believe that the problem was due to
> a race condition in the kernel.  Two process tried to SIOCAIFADDR with
> the same address simultaneously.  The second one of them failed and
> printed the error message that you see.  But due to the race, the
> first process reported success, yet the interface did not get the
> address.  Unfortunately, I was unable to locate the race.  My solution
> was to prevent two processes from trying to initialize the interface
> at the same time.  The first process was our custom management
> software, which calls "service netif cloneup lagg0" and "service netif
> start lagg0" in rapid succession.  The second process was devd, which
> was trying to initialize the newly attached lagg0 interface.  I
> commented out the following lines in /etc/devd.conf and the problem
> went away.  I don't know if this will solve your problem, but I
> recommend that you use dtrace or some other method to determine
> whether two processes are trying to SIOCAIFADDR at the same time.
>
> notify 0 {
>         match "system"          "IFNET";
>         match "type"            "ATTACH";
>         action "/etc/pccard_ether $subsystem start";
> };
>
>
Hey Alan!

Well, I don`t think it is the problem here. I just try to do a very simple
ifconfig, nothing more, there are no private applications running (I have
postgres siting around and munin gathering sysinfo to me). I was thinking
about some problem in the interaction ifconfig/adresses + routed, but this
is very strange.

In a less destructive test (the first one took me to reboot the machine), I
see a confusing behavior:

. put a alias into an igb1
. remove this alias (-alias)
. printing the main (#0) FIB, nothing is there related to the removed alias
. put the same alias again
. get the File exists result and no configuration of an alias over the igb1
. but now, listing the main routing table, there are info about that
alias!, but in another port of the NIC, igb2

How is this possible?


More information about the freebsd-net mailing list