summaryrefslogtreecommitdiff
path: root/pimd/pim_nb_config.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-05-17 07:20:08 -0400
committerGitHub <noreply@github.com>2022-05-17 07:20:08 -0400
commit8a8ad459af710c0b91cddef5ca354d34e59a823f (patch)
tree6f3aef2da70394bc110e555e68f3cc02cbd9c040 /pimd/pim_nb_config.c
parentb2ca7559b4caa282e56e5be9ba9e3731466939be (diff)
parent9299cea5dc112583242aaa11ee45c4a777673a07 (diff)
Merge pull request #10775 from opensourcerouting/pim6-mld-pr
pim6d: MLD code
Diffstat (limited to 'pimd/pim_nb_config.c')
-rw-r--r--pimd/pim_nb_config.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c
index 34438120b9..c855ad7e01 100644
--- a/pimd/pim_nb_config.c
+++ b/pimd/pim_nb_config.c
@@ -35,6 +35,7 @@
#include "log.h"
#include "lib_errors.h"
#include "pim_util.h"
+#include "pim6_mld.h"
#if PIM_IPV == 6
#define pim6_msdp_err(funcname, argtype) \
@@ -2702,12 +2703,22 @@ int lib_interface_gmp_address_family_igmp_version_destroy(
int lib_interface_gmp_address_family_mld_version_modify(
struct nb_cb_modify_args *args)
{
+ struct interface *ifp;
+ struct pim_interface *pim_ifp;
+
switch (args->event) {
case NB_EV_VALIDATE:
case NB_EV_PREPARE:
case NB_EV_ABORT:
+ break;
case NB_EV_APPLY:
- /* TBD depends on MLD data structure changes */
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return NB_ERR_INCONSISTENCY;
+
+ pim_ifp->mld_version = yang_dnode_get_uint8(args->dnode, NULL);
+ gm_ifp_update(ifp);
break;
}
@@ -2717,11 +2728,22 @@ int lib_interface_gmp_address_family_mld_version_modify(
int lib_interface_gmp_address_family_mld_version_destroy(
struct nb_cb_destroy_args *args)
{
+ struct interface *ifp;
+ struct pim_interface *pim_ifp;
+
switch (args->event) {
case NB_EV_VALIDATE:
case NB_EV_PREPARE:
case NB_EV_ABORT:
+ break;
case NB_EV_APPLY:
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return NB_ERR_INCONSISTENCY;
+
+ pim_ifp->mld_version = 2;
+ gm_ifp_update(ifp);
break;
}
@@ -2734,10 +2756,10 @@ int lib_interface_gmp_address_family_mld_version_destroy(
int lib_interface_gmp_address_family_query_interval_modify(
struct nb_cb_modify_args *args)
{
-#if PIM_IPV == 4
struct interface *ifp;
int query_interval;
+#if PIM_IPV == 4
switch (args->event) {
case NB_EV_VALIDATE:
case NB_EV_PREPARE:
@@ -2749,7 +2771,23 @@ int lib_interface_gmp_address_family_query_interval_modify(
change_query_interval(ifp->info, query_interval);
}
#else
- /* TBD Depends on MLD data structure changes */
+ struct pim_interface *pim_ifp;
+
+ switch (args->event) {
+ case NB_EV_VALIDATE:
+ case NB_EV_PREPARE:
+ case NB_EV_ABORT:
+ break;
+ case NB_EV_APPLY:
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return NB_ERR_INCONSISTENCY;
+
+ query_interval = yang_dnode_get_uint16(args->dnode, NULL);
+ pim_ifp->gm_default_query_interval = query_interval;
+ gm_ifp_update(ifp);
+ }
#endif
return NB_OK;
}