From 509aab5debef5b4710d8983da6ef076a226fd7ea Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 2 Mar 2015 10:58:20 +0100 Subject: Fixes serious bug in BGP add-path Temporary rta is reused in BGP, while rta_lookup() breaks it. Thanks to Alexander Chernikov for analysing the problem. --- proto/bgp/packets.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proto') diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 69646c7d..d34e7c56 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -999,7 +999,11 @@ bgp_rte_update(struct bgp_proto *p, ip_addr prefix, int pxlen, if (!*a) { a0->src = *src; + + /* Workaround for rta_lookup() breaking eattrs */ + ea_list *ea = a0->eattrs; *a = rta_lookup(a0); + a0->eattrs = ea; } net *n = net_get(p->p.table, prefix, pxlen); -- cgit v1.2.3