Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: ensure that installed srte policies have an output label #47

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions zebra/zebra_srte.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ int zebra_sr_policy_bsid_install(struct zebra_sr_policy *policy)
frr_each_safe(nhlfe_list, &policy->lsp->nhlfe_list, nhlfe) {
uint8_t num_out_labels;
mpls_label_t *out_labels;
mpls_label_t null_label = MPLS_LABEL_IMPLICIT_NULL;

if (!CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_SELECTED)
|| CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_DELETED))
Expand All @@ -314,8 +315,13 @@ int zebra_sr_policy_bsid_install(struct zebra_sr_policy *policy)
*/
if (!nhlfe->nexthop->nh_label || !nhlfe->nexthop->nh_label->num_labels
|| nhlfe->nexthop->nh_label->label[0] == MPLS_LABEL_IMPLICIT_NULL) {
num_out_labels = zt->label_num - 1;
out_labels = &zt->labels[1];
if (zt->label_num > 1) {
num_out_labels = zt->label_num - 1;
out_labels = &zt->labels[1];
} else {
num_out_labels = 1;
out_labels = &null_label;
}
} else {
num_out_labels = zt->label_num;
out_labels = zt->labels;
Expand Down