Bird not installing OSPF learned routes into routing tables

Ondrej Zajicek santiago at crfreenet.org
Mon Oct 28 14:34:43 CET 2013


On Sat, Oct 26, 2013 at 11:53:15PM +0400, Alexander V. Chernikov wrote:
> 2 Ondrej:
> Hi, i'm a bit stuck:

Hi, thanks for finding the problem.

> For p2p interfaces, like gifX the following happens:
>
> ifconfig gif0 inet 10.10.0.1/30 10.10.0.2
>
> bird: (FIN) IF gre0 flags: 60000188 ip: 10.10.0.1 opposite: 10.10.0.2  
> brd: 10.10.0.2
> ^^^^^
> Kernel sets broadcast address to the peer address for given p2p  
> interface even with non/32 masks.
> This seems "reasonable".

I would say that kernel (BSD) uses the same field (RTA_BRD)
for two purposes - broadcast address for broadcast ifaces
and peer address for ptp ifaces.

The questionable is that BIRD, which has two fields in struc ifa
(brd and opposite), copies peer address also to 'brd' field for
nonbroadcast ifaces.

> if_connected() uses the following logic:
> is peer? (IA_PEER) -> opposite ? OK!
> not peer? -> not network addr ? not broadcast ? then OK!
>
> Currently such interfaces are treated by nest as non-multiaccess, but  
> IA_PEER is not set.
>
> As a result, peer address is not treated as directly connected, so  
> neigh_find2() returns NULL, so all LSA behind given router has their gw  
> zeroed, so..

BTW, the same problem would be here for /31 addresses, but there is
a special check for that in if_connected():
(b->pxlen < (BITS_PER_IP_ADDRESS - 1)

> What is better: ignore kernel-supplied broadcast address or set IA_PEER  
> for non-/32 masks and non-multiaccess media?

Definitely not the second one.

Meaning of ifa->brd is an address which could be used to send a
broadcast packet (which is used by RIP in broadcast mode and OSPFv2 with
real-broadcast option).

Therefore, if an iface supports broadcast (i.e. iface->flags has
IF_BROADCAST flag), we should set ifa->brd to such address (which
is probably the one reported by kernel). If an iface does not support
broadcast, we should keep ifa->brd zeroed. This would fix the reported
problem.

See (end of) the attached patch (untested).

-- 
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."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broadcast.patch
Type: text/x-diff
Size: 1862 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20131028/cbc4c798/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20131028/cbc4c798/attachment-0001.asc>


More information about the Bird-users mailing list