Skip to content

Commit

Permalink
vxlan: remove vxlan_group_used in vxlan_open
Browse files Browse the repository at this point in the history
In vxlan_open, vxlan_group_used always returns true,
because the state of the vxlan deivces which we want
to open has alreay been running. and it has already
in vxlan_list.

Since ip_mc_join_group takes care of the reference
of struct ip_mc_list. removing vxlan_group_used here
is safe.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gao feng authored and David S. Miller committed Dec 11, 2013
1 parent 1a0ab76 commit 79d4a94
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,16 +1935,14 @@ static void vxlan_uninit(struct net_device *dev)
/* Start ageing timer and join group when device is brought up */
static int vxlan_open(struct net_device *dev)
{
struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
struct vxlan_dev *vxlan = netdev_priv(dev);
struct vxlan_sock *vs = vxlan->vn_sock;

/* socket hasn't been created */
if (!vs)
return -ENOTCONN;

if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip) &&
vxlan_group_used(vn, &vxlan->default_dst.remote_ip)) {
if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) {
vxlan_sock_hold(vs);
dev_hold(dev);
queue_work(vxlan_wq, &vxlan->igmp_join);
Expand Down

0 comments on commit 79d4a94

Please sign in to comment.