mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 10:04:18 +00:00
zebra: fix mpls command
Configured with "mpls label bind 1.1.1.1/32 explicit-null", the running
configuration is:
```
!
mpls label bind 1.1.1.1/32 IPv4 Explicit Null
!
```
After this commit, the running configuration is:
```
!
mpls label bind 1.1.1.1/32 explicit-null
!
```
And add the support for the "no" form:
```
anlan(config)# mpls label bind 1.1.1.1/32 explicit-null
anlan(config)# no mpls label bind 1.1.1.1/32 explicit-null
```
Signed-off-by: anlan_cs <anlan_cs@tom.com>
(cherry picked from commit 05ad3ccb03
)
This commit is contained in:
parent
a784c34ed8
commit
0f9fdde1b5
@ -2634,8 +2634,16 @@ int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
write = 1;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ DEFUN (mpls_label_bind,
|
|||||||
|
|
||||||
DEFUN (no_mpls_label_bind,
|
DEFUN (no_mpls_label_bind,
|
||||||
no_mpls_label_bind_cmd,
|
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
|
NO_STR
|
||||||
MPLS_STR
|
MPLS_STR
|
||||||
"Label configuration\n"
|
"Label configuration\n"
|
||||||
@ -255,7 +255,8 @@ DEFUN (no_mpls_label_bind,
|
|||||||
"IPv4 prefix\n"
|
"IPv4 prefix\n"
|
||||||
"IPv6 prefix\n"
|
"IPv6 prefix\n"
|
||||||
"MPLS Label to bind\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);
|
return zebra_mpls_bind(vty, 0, argv[4]->arg, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user