]> git.ipfire.org Git - thirdparty/bird.git/commit
BSD: Assume onlink flag on ifaces with only host addresses
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 27 Dec 2021 18:10:35 +0000 (19:10 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 27 Dec 2021 20:00:04 +0000 (21:00 +0100)
commita39cd2cc0b0c64235457c07e2b618318bbdfcacd
tree8406aeb44a408fb4692ebcf5d9d32054d5c54994
parentb9f38727a7ba7c9c7e383ade80dbf77086dfce05
BSD: Assume onlink flag on ifaces with only host addresses

The BSD kernel does not support the onlink flag and BIRD does not use
direct routes for next hop validation, instead depends on interface
address ranges. We would like to handle PtMP cases with only host
addresses configured, like:

  ifconfig wg0 192.168.0.10/32
  route add 192.168.0.4 -iface wg0
  route add 192.168.0.8 -iface wg0

To accept BIRD routes with onlink next-hop, like:

  route 192.168.42.0/24 via 192.168.0.4%wg0 onlink

BIRD would dismiss the route when receiving from the kernel, as the
next-hop 192.168.0.4 is not part of any interface subnet and onlink
flag is not kept by the BSD kernel.

The commit fixes this by assuming that for routes received from the
kernel, any next-hop is onlink on ifaces with only host addresses.

Thanks to Stefan Haller for the original patch.
sysdep/bsd/krt-sock.c