diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-05-18 15:11:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-18 15:11:39 +0200 |
commit | 4769239967a503bd673066a71eeb082d6cbf92f3 (patch) | |
tree | 53696cc01ca25bc8e4ef3657ae1aa14708aad16f /zebra | |
parent | Merge pull request #16009 from anlancs/zebra/fix-fpm-nl (diff) | |
parent | zebra: fix mpls command (diff) | |
download | frr-4769239967a503bd673066a71eeb082d6cbf92f3.tar.xz frr-4769239967a503bd673066a71eeb082d6cbf92f3.zip |
Merge pull request #16019 from anlancs/ldpd/fix-cmd-1
zebra: fix mpls command
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_mpls.c | 12 | ||||
-rw-r--r-- | zebra/zebra_mpls_vty.c | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 4cc85d461..d1c9cd54a 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -2638,8 +2638,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); } } diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index 8248d4a55..b31bf449a 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -247,7 +247,7 @@ 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" @@ -255,7 +255,8 @@ DEFUN (no_mpls_label_bind, "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); } |