mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 20:32:18 +00:00
zebra: fix 'no mpls' command by using 'mpls disable' instead
The 'no mpls' command wrongly assumes the user wants to disable
the mpls handling on the interface whereas this is just a config
knob that should mean 'I don't care with mpls'.
Fix this by adding a 'disable' option to the mpls command.
Fixes: 39ffa8e8e8
("zebra: Add a `mpls enable` interface node command")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
8ceb262401
commit
8291e3a313
@ -3777,20 +3777,24 @@ DEFUN (multicast,
|
||||
|
||||
DEFPY (mpls,
|
||||
mpls_cmd,
|
||||
"[no] mpls enable",
|
||||
"[no] mpls <enable$on|disable$off>",
|
||||
NO_STR
|
||||
MPLS_STR
|
||||
"Set mpls to be on for the interface\n")
|
||||
"Set mpls to be on for the interface\n"
|
||||
"Set mpls to be off for the interface\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct zebra_if *if_data = ifp->info;
|
||||
|
||||
if (no) {
|
||||
dplane_intf_mpls_modify_state(ifp, false);
|
||||
/* keep the state as it is */
|
||||
if_data->mpls_config = IF_ZEBRA_DATA_UNSPEC;
|
||||
} else {
|
||||
dplane_intf_mpls_modify_state(ifp, true);
|
||||
dplane_intf_mpls_modify_state(ifp, !!on);
|
||||
if (on)
|
||||
if_data->mpls_config = IF_ZEBRA_DATA_ON;
|
||||
else
|
||||
if_data->mpls_config = IF_ZEBRA_DATA_OFF;
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
@ -5633,6 +5637,9 @@ static int if_config_write(struct vty *vty)
|
||||
|
||||
if (if_data->mpls_config == IF_ZEBRA_DATA_ON)
|
||||
vty_out(vty, " mpls enable\n");
|
||||
else if (if_data->mpls_config ==
|
||||
IF_ZEBRA_DATA_OFF)
|
||||
vty_out(vty, " mpls disable\n");
|
||||
}
|
||||
|
||||
hook_call(zebra_if_config_wr, vty, ifp);
|
||||
|
Loading…
Reference in New Issue
Block a user