Update sharpd's zapi client code to support labelled nexthops if
they're present in a nexthop-group.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
struct mpls_label_stack *nh_label;
int i;
+ if (num_labels == 0)
+ return;
+
nexthop->nh_label_type = type;
nh_label = XCALLOC(MTYPE_NH_LABEL,
sizeof(struct mpls_label_stack)
api_nh->bh_type = nh->bh_type;
break;
}
+
+ if (nh->nh_label && nh->nh_label->num_labels > 0) {
+ int j;
+
+ SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
+
+ api_nh->label_num = nh->nh_label->num_labels;
+ for (j = 0; j < nh->nh_label->num_labels; j++)
+ api_nh->labels[j] = nh->nh_label->label[j];
+ }
+
i++;
}
api.nexthop_num = i;