]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vxlan: call peernet2id() in fdb notification
authorWANG Cong <xiyou.wangcong@gmail.com>
Fri, 2 Sep 2016 04:53:44 +0000 (21:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Sep 2016 18:39:58 +0000 (11:39 -0700)
netns id should be already allocated each time we change
netns, that is, in dev_change_net_namespace() (more precisely
in rtnl_fill_ifinfo()). It is safe to just call peernet2id() here.

Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
net/core/net_namespace.c

index f605a3684a7f75730e1f5d0d36d8bbcd135566d4..9735059dee9941526e7cb0b92986eee5db1af1b7 100644 (file)
@@ -287,7 +287,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
 
        if (!net_eq(dev_net(vxlan->dev), vxlan->net) &&
            nla_put_s32(skb, NDA_LINK_NETNSID,
-                       peernet2id_alloc(dev_net(vxlan->dev), vxlan->net)))
+                       peernet2id(dev_net(vxlan->dev), vxlan->net)))
                goto nla_put_failure;
 
        if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr))
index 7a77dcabd4e878ac6ab9338718fdbd8dd7ea423c..f3fa43506f16f34b21700644361f83cab3f7ab2b 100644 (file)
@@ -227,7 +227,6 @@ int peernet2id_alloc(struct net *net, struct net *peer)
                rtnl_net_notifyid(net, RTM_NEWNSID, id);
        return id;
 }
-EXPORT_SYMBOL(peernet2id_alloc);
 
 /* This function returns, if assigned, the id of a peer netns. */
 int peernet2id(struct net *net, struct net *peer)
@@ -240,6 +239,7 @@ int peernet2id(struct net *net, struct net *peer)
        spin_unlock_irqrestore(&net->nsid_lock, flags);
        return id;
 }
+EXPORT_SYMBOL(peernet2id);
 
 /* This function returns true is the peer netns has an id assigned into the
  * current netns.