Message ID | 20140329082918.GA5720@zed |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Mike Rapoport <mike.rapoport@ravellosystems.com> Date: Sat, 29 Mar 2014 11:29:18 +0300 > Hi David, > > On Tue, Mar 25, 2014 at 08:53:24PM -0400, David Miller wrote: >> >> It turns out we are going to partially revert that commit and >> iptunnel_pull_header() will start doing the skb_dst_drop() again. >> >> See: >> >> http://patchwork.ozlabs.org/patch/332956/ >> >> for details. >> >> Will that fix this bug too? > > I've found some more corner cases in the vxlan driver and the patch > below fixes them and my custom configuration case as well. Mike, please submit this formally for inclusion, in a fresh patch posting, without any other unrelated context, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 1236812..d091e52 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -871,6 +871,9 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], if (err) return err; + if (vxlan->default_dst.remote_ip.sa.sa_family != ip.sa.sa_family) + return -EAFNOSUPPORT; + spin_lock_bh(&vxlan->hash_lock); err = vxlan_fdb_create(vxlan, addr, &ip, ndm->ndm_state, flags, port, vni, ifindex, ndm->ndm_flags); @@ -2612,9 +2615,10 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, vni = nla_get_u32(data[IFLA_VXLAN_ID]); dst->remote_vni = vni; + /* Unless IPv6 is explicitly requested, assume IPv4 */ + dst->remote_ip.sa.sa_family = AF_INET; if (data[IFLA_VXLAN_GROUP]) { dst->remote_ip.sin.sin_addr.s_addr = nla_get_be32(data[IFLA_VXLAN_GROUP]); - dst->remote_ip.sa.sa_family = AF_INET; } else if (data[IFLA_VXLAN_GROUP6]) { if (!IS_ENABLED(CONFIG_IPV6)) return -EPFNOSUPPORT;