BFD socket bind error upon reboot

Ondrej Zajicek santiago at crfreenet.org
Wed Aug 15 14:25:05 CEST 2018


On Wed, Aug 15, 2018 at 11:23:33AM +0200, J. Kendzorra wrote:
> Hi,
> 
> > Generally, BIRD should not try to use an address before it notices that
> > the address is available/active. If BIRD tries to bind the socket before
> > that, then it is a bug.
> 
> This seems to be a common pattern for services that are started when network
> is supposedly ready, but it really isn't (see many discussions around
> network.target vs. network-online.target).

Well, BIRD should not depend on starting when network is supposedly
ready, as it should handle when interfaces/addresses are added or
removed during its run.


> > Which BIRD version it is? It is an IPv6 address? Which protocol caused
> > the BFD session or it is static one? I would suspect that the issue
> > is related to IPv6 DAD.
> 
> Unfortunately, that's not the case; we have BFD enabled only for IPv4
> 
> protocol bfd bfd_internal {
>   neighbor 192.168.1.2;
> (...)
>   neighbor 192.168.1.10;
> };
> 
> We're running bird 1.6.3-3 (Ubuntu Bionic).
> The error I've seen when the BFD sessions didn't come up was this:
> <ERR> bfd_internal: Socket error: bind: Cannot assign requested address
> 
> Since the listeners on ports 3784 and 4784 are wildcard binds, those
> shouldn't generate the error. However, there's a tx socket for communication
> with BFD peers on a random port (192.168.1.1:38164 as of today :) which I

Just a guess, don't you have two IP addresses from the same range on the
machine, or some other address/range that covers 192.168.1.2-10? As it
does not check really for availability of the local listening addres, but
for availability of the neighbor address. But in such case it will use the
second address, unless the first one is explicitly configured.

> I added some debug code to the sections where the BFD protocol binds sockets
> to catch when the bind happens and the error occurs (to support my theory),
> however I haven't been able to replicate the problem yet.

It may be also usefult to add enable debug { events, interfaces } for
device and BFD protocols.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


More information about the Bird-users mailing list