Merge pull request #5498 from mjstapp/sharp_with_labels

lib,sharpd: support labelled nexthop-groups in sharpd
This commit is contained in:
Donald Sharp 2019-12-07 11:44:02 -05:00 committed by GitHub
commit 0dcbec72aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -376,6 +376,9 @@ void nexthop_add_labels(struct nexthop *nexthop, enum lsp_types_t type,
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)

View File

@ -265,6 +265,17 @@ void route_add(struct prefix *p, vrf_id_t vrf_id,
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;