Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2013 13:21:20 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Raimundo Santos <raitech@gmail.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: ifconfig: ioctl (SIOCAIFADDR): File exists - but not only with alias command
Message-ID:  <CAOtMX2iwX8ZvArEMngaactpMOCdr7=6a-ZpeKzoBtnBXaF%2BdPA@mail.gmail.com>
In-Reply-To: <CAGQ6iC8F-WNWC6YP7-KnmWHY47ZeBKi41ksTL%2BoQ2PjDmYcxDw@mail.gmail.com>
References:  <CAGQ6iC-fKZARrqQrhbswS3YGZqOfOctR9C7B6xSO43LnXh_yTw@mail.gmail.com> <CAOtMX2iVnT2vmXTyqgOAEm51XhzhL6M14Nf719KotN9Oamk0fg@mail.gmail.com> <CAGQ6iC8F-WNWC6YP7-KnmWHY47ZeBKi41ksTL%2BoQ2PjDmYcxDw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 16, 2013 at 1:13 PM, Raimundo Santos <raitech@gmail.com> wrote:
> On 16 October 2013 15:54, Alan Somers <asomers@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?

It's sad to say, but the fib code is pretty buggy.  Without diving
into the source, one thing that you could try is the
net.add_addr_allfibs tunable.  I think that it defaults to 1.  If you
set it to 0, then adding an interface address in one fib will not
cause it to create routes in other fibs.  Does that help?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2iwX8ZvArEMngaactpMOCdr7=6a-ZpeKzoBtnBXaF%2BdPA>