]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use RTA_MAX_SIZE in rta_do_cow()
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 14 Mar 2023 15:02:32 +0000 (16:02 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 24 Oct 2023 12:25:18 +0000 (14:25 +0200)
This allows to modify MPLS label stack in filters. Fixes a bug in
handling of 'gw_mpls' attribute.

nest/rt-attr.c

index 7beb119b797be2634c024e4bd9db86d0af495cb9..25936d81d16ea757083c8ac74e3fd7b4f4a103d3 100644 (file)
@@ -1264,7 +1264,7 @@ rta__free(rta *a)
 rta *
 rta_do_cow(rta *o, linpool *lp)
 {
-  rta *r = lp_alloc(lp, rta_size(o));
+  rta *r = lp_alloc(lp, RTA_MAX_SIZE);
   memcpy(r, o, rta_size(o));
   for (struct nexthop **nhn = &(r->nh.next), *nho = o->nh.next; nho; nho = nho->next)
     {