]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix bug in nexthop label allocation
authorßingen <bingen@voltanet.io>
Thu, 15 Sep 2016 10:28:52 +0000 (12:28 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Sep 2016 13:31:21 +0000 (09:31 -0400)
Label array in nexthop_label struct was not being allocated.

lib/nexthop.c

index 01771e253c02bac8c3319a71e3aa0f82c5c99fca..23ee28b7dcb58ec1ff3fca0956155fc378c04ef9 100644 (file)
@@ -171,7 +171,8 @@ nexthop_add_labels (struct nexthop *nexthop, enum lsp_types_t type,
   int i;
 
   nexthop->nh_label_type = type;
-  nh_label = XCALLOC (MTYPE_NH_LABEL, sizeof (struct nexthop_label));
+  nh_label = XCALLOC (MTYPE_NH_LABEL, sizeof (struct nexthop_label) +
+                     num_labels * sizeof (mpls_label_t));
   nh_label->num_labels = num_labels;
   for (i = 0; i < num_labels; i++)
     nh_label->label[i] = *(label + i);