summaryrefslogtreecommitdiffstats
path: root/drivers/net/geneve.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-01-01 00:20:10 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-01 00:20:10 +0100
commitc07f30ad68053181b3e8a0e65b0630e12e844f91 (patch)
tree8758968aabc844c435ff2a5d7d02c835fccd02a3 /drivers/net/geneve.c
parentMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentMerge tag 'pci-v4.4-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-c07f30ad68053181b3e8a0e65b0630e12e844f91.tar.xz
linux-c07f30ad68053181b3e8a0e65b0630e12e844f91.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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 20dd66423ec8..24b077a32c1c 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1223,7 +1223,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;
@@ -1256,6 +1256,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;