summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_nb_config.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-17 13:28:13 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-28 22:28:39 +0100
commitefa18c6c6ff84a71c70435d901421599500af5d2 (patch)
treecf26f9c7b42bbebf143ba76e1ef846911102e040 /zebra/zebra_nb_config.c
parenttests: fix test_bgp_recursive_route_ebgp_multi_hop (diff)
downloadfrr-efa18c6c6ff84a71c70435d901421599500af5d2.tar.xz
frr-efa18c6c6ff84a71c70435d901421599500af5d2.zip
zebra: convert inteface multicast command to NB
Introduce new "[no] multicast <enable|disable>" command to be able to remove the configuration. Current "[no] multicast" command cannot be removed. Current command is hidden but still works for backwards compatibility. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_nb_config.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/zebra_nb_config.c b/zebra/zebra_nb_config.c
index 98c241b2a..c51250e76 100644
--- a/zebra/zebra_nb_config.c
+++ b/zebra/zebra_nb_config.c
@@ -999,10 +999,14 @@ int lib_interface_zebra_multicast_modify(struct nb_cb_modify_args *args)
return NB_OK;
struct interface *ifp;
+ bool multicast = yang_dnode_get_bool(args->dnode, NULL);
ifp = nb_running_get_entry(args->dnode, NULL, true);
- if_multicast_set(ifp);
+ if (multicast)
+ if_multicast_set(ifp);
+ else
+ if_multicast_unset(ifp);
return NB_OK;
}
@@ -1013,10 +1017,12 @@ int lib_interface_zebra_multicast_destroy(struct nb_cb_destroy_args *args)
return NB_OK;
struct interface *ifp;
+ struct zebra_if *zif;
ifp = nb_running_get_entry(args->dnode, NULL, true);
+ zif = ifp->info;
- if_multicast_unset(ifp);
+ zif->multicast = IF_ZEBRA_DATA_UNSPEC;
return NB_OK;
}