diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-07-09 21:44:03 +0200 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-08-10 18:13:21 +0200 |
| commit | 7832bbcc30cd770e2f85b0b96fb0a4f09e29095e (patch) | |
| tree | 1bb30be0c68d4804a1c951ce6078410e8ecd42b3 /zebra/interface.c | |
| parent | 8291e3a3138163b169441dbb321b863cb7b6a345 (diff) | |
zebra, yang: add an mpls leaf to interface
The yang NB API does not handle the mpls configuration
on its leaf.
Add an mpls leaf to stick to the mpls configuration.
- true or false to mean if config
- not defined, means no config.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index c92f149e23..ab2b7d2446 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -3783,21 +3783,14 @@ DEFPY (mpls, "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) { - /* keep the state as it is */ - if_data->mpls_config = IF_ZEBRA_DATA_UNSPEC; - } else { - 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; - } + if (!no) + nb_cli_enqueue_change(vty, "./frr-zebra:zebra/mpls", + NB_OP_CREATE, on ? "true" : "false"); + else + nb_cli_enqueue_change(vty, "./frr-zebra:zebra/mpls", + NB_OP_DESTROY, NULL); - return CMD_SUCCESS; + return nb_cli_apply_changes(vty, NULL); } int if_multicast_unset(struct interface *ifp) |
