c11 safe string handling support
[vpp.git] / src / plugins / igmp / igmp_group.c
index fe023a4..38499e4 100644 (file)
@@ -74,6 +74,14 @@ igmp_group_clear (igmp_group_t * group)
 
   config = igmp_config_get (group->config);
 
+  /* If interface is in ROUTER mode and IGMP proxy is enabled
+   * remove mfib path.
+   */
+  if (config->mode == IGMP_MODE_ROUTER)
+    {
+      igmp_proxy_device_mfib_path_add_del (group, /* add */ 0);
+    }
+
   IGMP_DBG ("clear-group: %U %U",
            format_igmp_key, group->key,
            format_vnet_sw_if_index_name,
@@ -101,7 +109,7 @@ igmp_group_alloc (igmp_config_t * config,
 
   IGMP_DBG ("new-group: %U", format_igmp_key, gkey);
   pool_get (im->groups, group);
-  memset (group, 0, sizeof (igmp_group_t));
+  clib_memset (group, 0, sizeof (igmp_group_t));
   group->key = clib_mem_alloc (sizeof (igmp_key_t));
   clib_memcpy (group->key, gkey, sizeof (igmp_key_t));
   group->igmp_src_by_key[IGMP_FILTER_MODE_INCLUDE] =
@@ -116,6 +124,15 @@ igmp_group_alloc (igmp_config_t * config,
     group->timers[ii] = IGMP_TIMER_ID_INVALID;
 
   hash_set_mem (config->igmp_group_by_key, group->key, group - im->groups);
+
+  /* If interface is in ROUTER mode and IGMP proxy is enabled
+   * add mfib path.
+   */
+  if (config->mode == IGMP_MODE_ROUTER)
+    {
+      igmp_proxy_device_mfib_path_add_del (group, /* add */ 1);
+    }
+
   return (group);
 }