netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <therbert@google.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH v2 net-next 1/4] ip_tunnel: Account for secondary encapsulation header in max_headroom
Date: Fri,  3 Oct 2014 15:48:07 -0700	[thread overview]
Message-ID: <1412376490-8774-2-git-send-email-therbert@google.com> (raw)
In-Reply-To: <1412376490-8774-1-git-send-email-therbert@google.com>

When adjusting max_header for the tunnel interface based on egress
device we need to account for any extra bytes in secondary encapsulation
(e.g. FOU).

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv4/ip_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index b75b47b..54ace25 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -759,7 +759,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
 		df |= (inner_iph->frag_off&htons(IP_DF));
 
 	max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr)
-			+ rt->dst.header_len;
+			+ rt->dst.header_len + ip_encap_hlen(&tunnel->encap);
 	if (max_headroom > dev->needed_headroom)
 		dev->needed_headroom = max_headroom;
 
-- 
2.1.0.rc2.206.gedb03e5

  reply	other threads:[~2014-10-03 22:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 22:48 [PATCH v2 net-next 0/4] net: Generic UDP Encapsulation Tom Herbert
2014-10-03 22:48 ` Tom Herbert [this message]
2014-10-03 22:48 ` [PATCH v2 net-next 2/4] fou: eliminate IPv4,v6 specific GRO functions Tom Herbert
2014-10-03 22:48 ` [PATCH v2 net-next 3/4] gue: Receive side for Generic UDP Encapsulation Tom Herbert
2014-10-03 22:48 ` [PATCH v2 net-next 4/4] ip_tunnel: Add GUE support Tom Herbert
2014-10-03 23:57 ` [PATCH v2 net-next 0/4] net: Generic UDP Encapsulation David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412376490-8774-2-git-send-email-therbert@google.com \
    --to=therbert@google.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).