Skip to content

Commit

Permalink
Merge pull request #16039 from FRRouting/mergify/bp/stable/9.1/pr-16019
Browse files Browse the repository at this point in the history
zebra: fix mpls command (backport #16019)
  • Loading branch information
Jafaral committed May 19, 2024
2 parents dfa1fc7 + b345592 commit 488c106
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions zebra/zebra_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -2691,8 +2691,16 @@ int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf)
continue;

write = 1;
vty_out(vty, "mpls label bind %pFX %s\n", &rn->p,
label2str(fec->label, 0, lstr, BUFSIZ));

if (fec->label == MPLS_LABEL_IPV4_EXPLICIT_NULL ||
fec->label == MPLS_LABEL_IPV6_EXPLICIT_NULL)
strlcpy(lstr, "explicit-null", sizeof(lstr));
else if (fec->label == MPLS_LABEL_IMPLICIT_NULL)
strlcpy(lstr, "implicit-null", sizeof(lstr));
else
snprintf(lstr, sizeof(lstr), "%d", fec->label);

vty_out(vty, "mpls label bind %pFX %s\n", &rn->p, lstr);
}
}

Expand Down
5 changes: 3 additions & 2 deletions zebra/zebra_mpls_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,16 @@ DEFUN (mpls_label_bind,

DEFUN (no_mpls_label_bind,
no_mpls_label_bind_cmd,
"no mpls label bind <A.B.C.D/M|X:X::X:X/M> [<(16-1048575)|implicit-null>]",
"no mpls label bind <A.B.C.D/M|X:X::X:X/M> [<(16-1048575)|implicit-null|explicit-null>]",
NO_STR
MPLS_STR
"Label configuration\n"
"Establish FEC to label binding\n"
"IPv4 prefix\n"
"IPv6 prefix\n"
"MPLS Label to bind\n"
"Use Implicit-Null Label\n")
"Use Implicit-Null Label\n"
"Use Explicit-Null Label\n")
{
return zebra_mpls_bind(vty, 0, argv[4]->arg, NULL);
}
Expand Down

0 comments on commit 488c106

Please sign in to comment.