[PATCH] Fix source-specific routing in Bird 3
Toke Høiland-Jørgensen
toke at toke.dk
Tue Feb 25 16:05:10 CET 2025
Commit 69d1ffde4c72 ("Split route data structure to storage (ro) /
manipulation (rw) structures.") changed rte->net from a pointer to a
'struct network' to a 'struct net_addr', but kept the address-of (&)
operator before casting to 'net_addr_ip6_sadr *' when sending a
source-specific route to the kernel.
Because 'struct network' had an embedded struct member (struct
fib_node), the address-of was needed to get back to a pointer to the
data, but with the change in the commit mentioned above, e->net is now a
straight pointer to the address.
The bug meant that the source prefixes passed to the kernel were
essentially garbage, leading to routes in the kernel like:
default from b74:9e05:0:1:d8cf:c000::/86 via fe80::1 dev eth0 proto bird metric 32 pref medium
Fix this by getting rid of the address-of operator.
Fixes: 69d1ffde4c72 ("Split route data structure to storage (ro) / manipulation (rw) structures.")
Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
---
sysdep/linux/netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 1703a67595d5..6cc0142c3e00 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -1494,7 +1494,7 @@ nl_send_route(struct krt_proto *p, const rte *e, int op)
/* Add source address for IPv6 SADR routes */
if (e->net->type == NET_IP6_SADR)
{
- net_addr_ip6_sadr *a = (void *) &e->net;
+ net_addr_ip6_sadr *a = (void *) e->net;
nl_add_attr_ip6(&r->h, rsize, RTA_SRC, a->src_prefix);
r->r.rtm_src_len = a->src_pxlen;
}
--
2.48.1
More information about the Bird-users
mailing list