Lines Matching refs:vxlan
17 int vxlan_igmp_join(struct vxlan_dev *vxlan, union vxlan_addr *rip, in vxlan_igmp_join() argument
20 union vxlan_addr *ip = (rip ? : &vxlan->default_dst.remote_ip); in vxlan_igmp_join()
21 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); in vxlan_igmp_join()
26 struct vxlan_sock *sock4 = rtnl_dereference(vxlan->vn4_sock); in vxlan_igmp_join()
38 struct vxlan_sock *sock6 = rtnl_dereference(vxlan->vn6_sock); in vxlan_igmp_join()
51 int vxlan_igmp_leave(struct vxlan_dev *vxlan, union vxlan_addr *rip, in vxlan_igmp_leave() argument
54 union vxlan_addr *ip = (rip ? : &vxlan->default_dst.remote_ip); in vxlan_igmp_leave()
55 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); in vxlan_igmp_leave()
60 struct vxlan_sock *sock4 = rtnl_dereference(vxlan->vn4_sock); in vxlan_igmp_leave()
72 struct vxlan_sock *sock6 = rtnl_dereference(vxlan->vn6_sock); in vxlan_igmp_leave()
100 static bool vxlan_group_used_by_vnifilter(struct vxlan_dev *vxlan, in vxlan_group_used_by_vnifilter() argument
103 struct vxlan_vni_group *vg = rtnl_dereference(vxlan->vnigrp); in vxlan_group_used_by_vnifilter()
107 &vxlan->default_dst.remote_ip, in vxlan_group_used_by_vnifilter()
108 vxlan->default_dst.remote_ifindex)) in vxlan_group_used_by_vnifilter()
117 vxlan->default_dst.remote_ifindex)) in vxlan_group_used_by_vnifilter()
130 struct vxlan_dev *vxlan; in vxlan_group_used() local
151 list_for_each_entry(vxlan, &vn->vxlan_list, next) { in vxlan_group_used()
152 if (!netif_running(vxlan->dev) || vxlan == dev) in vxlan_group_used()
156 rtnl_dereference(vxlan->vn4_sock) != sock4) in vxlan_group_used()
160 rtnl_dereference(vxlan->vn6_sock) != sock6) in vxlan_group_used()
163 if (vxlan->cfg.flags & VXLAN_F_VNIFILTER) { in vxlan_group_used()
164 if (!vxlan_group_used_by_vnifilter(vxlan, ip, ifindex)) in vxlan_group_used()
168 &vxlan->default_dst.remote_ip, in vxlan_group_used()
169 vxlan->default_dst.remote_ifindex)) in vxlan_group_used()
179 static int vxlan_multicast_join_vnigrp(struct vxlan_dev *vxlan) in vxlan_multicast_join_vnigrp() argument
181 struct vxlan_vni_group *vg = rtnl_dereference(vxlan->vnigrp); in vxlan_multicast_join_vnigrp()
190 &vxlan->default_dst.remote_ip)) in vxlan_multicast_join_vnigrp()
192 ret = vxlan_igmp_join(vxlan, &v->remote_ip, 0); in vxlan_multicast_join_vnigrp()
205 &vxlan->default_dst.remote_ip)) in vxlan_multicast_join_vnigrp()
207 vxlan_igmp_leave(vxlan, &v->remote_ip, 0); in vxlan_multicast_join_vnigrp()
216 static int vxlan_multicast_leave_vnigrp(struct vxlan_dev *vxlan) in vxlan_multicast_leave_vnigrp() argument
218 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); in vxlan_multicast_leave_vnigrp()
219 struct vxlan_vni_group *vg = rtnl_dereference(vxlan->vnigrp); in vxlan_multicast_leave_vnigrp()
225 !vxlan_group_used(vn, vxlan, v->vni, &v->remote_ip, in vxlan_multicast_leave_vnigrp()
227 ret = vxlan_igmp_leave(vxlan, &v->remote_ip, 0); in vxlan_multicast_leave_vnigrp()
236 int vxlan_multicast_join(struct vxlan_dev *vxlan) in vxlan_multicast_join() argument
240 if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) { in vxlan_multicast_join()
241 ret = vxlan_igmp_join(vxlan, &vxlan->default_dst.remote_ip, in vxlan_multicast_join()
242 vxlan->default_dst.remote_ifindex); in vxlan_multicast_join()
249 if (vxlan->cfg.flags & VXLAN_F_VNIFILTER) in vxlan_multicast_join()
250 return vxlan_multicast_join_vnigrp(vxlan); in vxlan_multicast_join()
255 int vxlan_multicast_leave(struct vxlan_dev *vxlan) in vxlan_multicast_leave() argument
257 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); in vxlan_multicast_leave()
260 if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip) && in vxlan_multicast_leave()
261 !vxlan_group_used(vn, vxlan, 0, NULL, 0)) { in vxlan_multicast_leave()
262 ret = vxlan_igmp_leave(vxlan, &vxlan->default_dst.remote_ip, in vxlan_multicast_leave()
263 vxlan->default_dst.remote_ifindex); in vxlan_multicast_leave()
268 if (vxlan->cfg.flags & VXLAN_F_VNIFILTER) in vxlan_multicast_leave()
269 return vxlan_multicast_leave_vnigrp(vxlan); in vxlan_multicast_leave()