]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added forgotten route source locking in flowspec validation
authorMaria Matejka <mq@ucw.cz>
Mon, 11 Jul 2022 11:04:01 +0000 (13:04 +0200)
committerMaria Matejka <mq@ucw.cz>
Mon, 11 Jul 2022 11:04:01 +0000 (13:04 +0200)
nest/rt-table.c

index 97bbc4f0c5d3746c5fc753ed6354d2b71b0d62bf..4500c8889c46927fac00a5d4236543c081716d04 100644 (file)
@@ -2674,7 +2674,7 @@ static rte *
 rt_flowspec_update_rte(rtable *tab, rte *r)
 {
 #ifdef CONFIG_BGP
-  if (r->attrs->source != RTS_BGP)
+  if ((r->attrs->source != RTS_BGP) || (r->sender->proto != r->src->proto))
     return NULL;
 
   struct bgp_channel *bc = (struct bgp_channel *) r->sender;
@@ -2697,6 +2697,7 @@ rt_flowspec_update_rte(rtable *tab, rte *r)
   rte *new = sl_alloc(rte_slab);
   memcpy(new, r, sizeof(rte));
   new->attrs = rta_lookup(a);
+  rt_lock_source(new->src);
 
   return new;
 #else