diff options
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 7fbd89fbe107..a8c755dcab14 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -2432,10 +2432,10 @@ static void vxlan_sock_work(struct work_struct *work) | |||
2432 | dev_put(vxlan->dev); | 2432 | dev_put(vxlan->dev); |
2433 | } | 2433 | } |
2434 | 2434 | ||
2435 | static int vxlan_newlink(struct net *net, struct net_device *dev, | 2435 | static int vxlan_newlink(struct net *src_net, struct net_device *dev, |
2436 | struct nlattr *tb[], struct nlattr *data[]) | 2436 | struct nlattr *tb[], struct nlattr *data[]) |
2437 | { | 2437 | { |
2438 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); | 2438 | struct vxlan_net *vn = net_generic(src_net, vxlan_net_id); |
2439 | struct vxlan_dev *vxlan = netdev_priv(dev); | 2439 | struct vxlan_dev *vxlan = netdev_priv(dev); |
2440 | struct vxlan_rdst *dst = &vxlan->default_dst; | 2440 | struct vxlan_rdst *dst = &vxlan->default_dst; |
2441 | __u32 vni; | 2441 | __u32 vni; |
@@ -2445,7 +2445,7 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, | |||
2445 | if (!data[IFLA_VXLAN_ID]) | 2445 | if (!data[IFLA_VXLAN_ID]) |
2446 | return -EINVAL; | 2446 | return -EINVAL; |
2447 | 2447 | ||
2448 | vxlan->net = dev_net(dev); | 2448 | vxlan->net = src_net; |
2449 | 2449 | ||
2450 | vni = nla_get_u32(data[IFLA_VXLAN_ID]); | 2450 | vni = nla_get_u32(data[IFLA_VXLAN_ID]); |
2451 | dst->remote_vni = vni; | 2451 | dst->remote_vni = vni; |
@@ -2481,7 +2481,7 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, | |||
2481 | if (data[IFLA_VXLAN_LINK] && | 2481 | if (data[IFLA_VXLAN_LINK] && |
2482 | (dst->remote_ifindex = nla_get_u32(data[IFLA_VXLAN_LINK]))) { | 2482 | (dst->remote_ifindex = nla_get_u32(data[IFLA_VXLAN_LINK]))) { |
2483 | struct net_device *lowerdev | 2483 | struct net_device *lowerdev |
2484 | = __dev_get_by_index(net, dst->remote_ifindex); | 2484 | = __dev_get_by_index(src_net, dst->remote_ifindex); |
2485 | 2485 | ||
2486 | if (!lowerdev) { | 2486 | if (!lowerdev) { |
2487 | pr_info("ifindex %d does not exist\n", dst->remote_ifindex); | 2487 | pr_info("ifindex %d does not exist\n", dst->remote_ifindex); |
@@ -2557,7 +2557,7 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, | |||
2557 | nla_get_u8(data[IFLA_VXLAN_UDP_ZERO_CSUM6_RX])) | 2557 | nla_get_u8(data[IFLA_VXLAN_UDP_ZERO_CSUM6_RX])) |
2558 | vxlan->flags |= VXLAN_F_UDP_ZERO_CSUM6_RX; | 2558 | vxlan->flags |= VXLAN_F_UDP_ZERO_CSUM6_RX; |
2559 | 2559 | ||
2560 | if (vxlan_find_vni(net, vni, use_ipv6 ? AF_INET6 : AF_INET, | 2560 | if (vxlan_find_vni(src_net, vni, use_ipv6 ? AF_INET6 : AF_INET, |
2561 | vxlan->dst_port)) { | 2561 | vxlan->dst_port)) { |
2562 | pr_info("duplicate VNI %u\n", vni); | 2562 | pr_info("duplicate VNI %u\n", vni); |
2563 | return -EEXIST; | 2563 | return -EEXIST; |