diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-05-18 16:11:39 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-18 16:11:39 +0300 | 
| commit | 4769239967a503bd673066a71eeb082d6cbf92f3 (patch) | |
| tree | 53696cc01ca25bc8e4ef3657ae1aa14708aad16f /zebra | |
| parent | 815b1d0e5863ca36da9abb4189a0d0014e993fc9 (diff) | |
| parent | 05ad3ccb034c174d2e853e88b826ca0db1e77f45 (diff) | |
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 4cc85d461f..d1c9cd54af 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 8248d4a555..b31bf449a9 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);  }  | 
