summaryrefslogtreecommitdiff
path: root/drivers/net/geneve.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-01-06 20:53:28 +0100
committerTakashi Iwai <tiwai@suse.de>2016-01-06 20:53:28 +0100
commit3f37b26f8d57756b591383a9d8ce1cd628bc773c (patch)
tree0311f4c48cfa7ace3940f3db203b930a2c2eaaa5 /drivers/net/geneve.c
parentc7b60a89516beb20a352ec85c73a8fccd5becf26 (diff)
parentbc42f363da213b4bf7c15a2dc87b2b1a85cde867 (diff)
Merge tag 'asoc-fix-v4.4-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linussound-4.4
ASoC: Last minute fixes for v4.4 A few final fixes for v4.4, the main one being the two patches to the new Sky Lake drivers which fix a previous incorrect fix that went in during an earlier -rc.
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r--drivers/net/geneve.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index c2b79f5d1c89..58efdec12f30 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1155,7 +1155,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
struct geneve_net *gn = net_generic(net, geneve_net_id);
struct geneve_dev *t, *geneve = netdev_priv(dev);
bool tun_collect_md, tun_on_same_port;
- int err;
+ int err, encap_len;
if (!remote)
return -EINVAL;
@@ -1187,6 +1187,14 @@ static int geneve_configure(struct net *net, struct net_device *dev,
if (t)
return -EBUSY;
+ /* make enough headroom for basic scenario */
+ encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
+ if (remote->sa.sa_family == AF_INET)
+ encap_len += sizeof(struct iphdr);
+ else
+ encap_len += sizeof(struct ipv6hdr);
+ dev->needed_headroom = encap_len + ETH_HLEN;
+
if (metadata) {
if (tun_on_same_port)
return -EPERM;