summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-03-02 10:58:20 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-03-02 10:58:20 +0100
commit509aab5debef5b4710d8983da6ef076a226fd7ea (patch)
treefc8ace1eed7655f7bc98e95977eed3884b9bb572 /proto/bgp/packets.c
parentaf454f9b7c3930a7900e60a7fb608b7de11852aa (diff)
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.
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c4
1 files changed, 4 insertions, 0 deletions
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);