return 0;
if (vni_mcast_grp)
- return zebra_vxlan_if_vni_mcast_group_update(
+ return zebra_vxlan_if_vni_mcast_group_add_update(
ifp, vni, &vtep_ip);
return zebra_vxlan_dp_network_mac_add(
if (dst_present) {
if (vni_mcast_grp)
- return zebra_vxlan_if_vni_mcast_group_update(ifp, vni,
- NULL);
+ return zebra_vxlan_if_vni_mcast_group_del(ifp, vni,
+ &vtep_ip);
if (is_zero_mac(&mac) && vni)
return zebra_vxlan_check_readd_vtep(ifp, vni, vtep_ip);
return 0;
}
-int zebra_vxlan_if_vni_mcast_group_update(struct interface *ifp, vni_t vni_id,
- struct in_addr *mcast_group)
+int zebra_vxlan_if_vni_mcast_group_add_update(struct interface *ifp,
+ vni_t vni_id,
+ struct in_addr *mcast_group)
{
struct zebra_if *zif;
struct zebra_vxlan_vni *vni;
ctx.old_vni.mcast_grp = vni->mcast_grp;
ctx.chgflags = ZEBRA_VXLIF_MCAST_GRP_CHANGE;
- if (mcast_group)
- vni->mcast_grp = *mcast_group;
- else
- memset(&vni->mcast_grp, 0, sizeof(vni->mcast_grp));
+ vni->mcast_grp = *mcast_group;
+
+ return zebra_vxlan_if_update_vni(ifp, vni, &ctx);
+}
+
+int zebra_vxlan_if_vni_mcast_group_del(struct interface *ifp, vni_t vni_id,
+ struct in_addr *mcast_group)
+{
+ struct zebra_if *zif = NULL;
+ struct zebra_vxlan_vni *vni;
+ struct zebra_vxlan_if_update_ctx ctx;
+
+ zif = (struct zebra_if *)ifp->info;
+
+ if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+ return 0;
+
+ vni = zebra_vxlan_if_vni_find(zif, vni_id);
+ if (!vni)
+ return 0;
+
+ if (memcmp(mcast_group, &vni->mcast_grp, sizeof(*mcast_group)))
+ return 0;
+
+ memset(&ctx, 0, sizeof(ctx));
+ ctx.old_vni.mcast_grp = vni->mcast_grp;
+ ctx.chgflags = ZEBRA_VXLIF_MCAST_GRP_CHANGE;
+
+ memset(&vni->mcast_grp, 0, sizeof(vni->mcast_grp));
return zebra_vxlan_if_update_vni(ifp, vni, &ctx);
}
void *arg);
extern vni_t zebra_vxlan_if_access_vlan_vni_find(struct zebra_if *zif,
struct interface *br_if);
-extern int zebra_vxlan_if_vni_mcast_group_update(struct interface *ifp,
- vni_t vni_id,
- struct in_addr *mcast_group);
+extern int
+zebra_vxlan_if_vni_mcast_group_add_update(struct interface *ifp, vni_t vni_id,
+ struct in_addr *mcast_group);
+extern int zebra_vxlan_if_vni_mcast_group_del(struct interface *ifp,
+ vni_t vni_id,
+ struct in_addr *mcast_group);
extern int zebra_vxlan_if_vni_down(struct interface *ifp,
struct zebra_vxlan_vni *vni);
extern int zebra_vxlan_if_down(struct interface *ifp);