datapath/linux/compat/vxlan.c
/* Notify netdevs that UDP port is no more listening */
Notify netdevs that UDP port is no more listening
Notify netdevs that UDP port is no more listening
static void vxlan_notify_del_rx_port(struct vxlan_sock *vs)
{
	struct net_device *dev;
	struct sock *sk = vs->sock->sk;
	struct net *net = sock_net(sk);
	sa_family_t sa_family = vxlan_get_sk_family(vs);
	rcu_read_lock();
	for_each_netdev_rcu(net, dev) {
#ifdef HAVE_NDO_ADD_VXLAN_PORT
		__be16 port = inet_sk(sk)->inet_sport;
		if (dev->netdev_ops->ndo_del_vxlan_port)
			dev->netdev_ops->ndo_del_vxlan_port(dev, sa_family,
					port);
#elif defined(HAVE_NDO_UDP_TUNNEL_ADD)
		struct udp_tunnel_info ti;
		if (vs->flags & VXLAN_F_GPE)
			ti.type = UDP_TUNNEL_TYPE_VXLAN_GPE;
		else
			ti.type = UDP_TUNNEL_TYPE_VXLAN;
		ti.port = inet_sk(sk)->inet_sport;
		ti.sa_family = sa_family;
		if (dev->netdev_ops->ndo_udp_tunnel_del)
			dev->netdev_ops->ndo_udp_tunnel_del(dev, &ti);
#endif
	}
	rcu_read_unlock();
	if (sa_family == AF_INET) {
		udp_del_offload(&vs->udp_offloads);
	}
}
static void vxlan_notify_del_rx_port ( struct vxlan_sock * vs ) { struct net_device * dev ; struct sock * sk = vs -> sock -> sk ; struct net * net = sock_net ( sk ) ; sa_family_t sa_family = vxlan_get_sk_family ( vs ) ; rcu_read_lock ( ) ; for_each_netdev_rcu ( net , dev ) { #ifdef HAVE_NDO_ADD_VXLAN_PORT __be16 port = inet_sk ( sk ) -> inet_sport ; if ( dev -> netdev_ops -> ndo_del_vxlan_port ) dev -> netdev_ops -> ndo_del_vxlan_port ( dev , sa_family , port ) ; #elif defined ( HAVE_NDO_UDP_TUNNEL_ADD ) struct udp_tunnel_info ti ; if ( vs -> flags & VXLAN_F_GPE ) ti . type = UDP_TUNNEL_TYPE_VXLAN_GPE ; else ti . type = UDP_TUNNEL_TYPE_VXLAN ; ti . port = inet_sk ( sk ) -> inet_sport ; ti . sa_family = sa_family ; if ( dev -> netdev_ops -> ndo_udp_tunnel_del ) dev -> netdev_ops -> ndo_udp_tunnel_del ( dev , & ti ) ; #endif } rcu_read_unlock ( ) ; if ( sa_family == AF_INET ) { udp_del_offload ( & vs -> udp_offloads ) ; } }
Notify netdevs that UDP port is no more listening
Notify netdevs that UDP port is no more listening