diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-03-19 22:27:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-22 00:23:28 -0400 |
commit | 243aad830e8a4cdda261626fbaeddde16b08d04a (patch) | |
tree | 3c8de91b5249846dede05c1a3a74387e0eda0470 /net | |
parent | 9bf35c8dddd56f7f247a27346f74f5adc18071f4 (diff) |
ip_gre: include route header_len in max_headroom calculation
Taking route's header_len into account, and updating gre device
needed_headroom will give better hints on upper bound of required
headroom. This is useful if the gre traffic is xfrm'ed.
Signed-off-by: Timo Teras <timo.teras@iki.fi>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_gre.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index f47c9f76754b..f78402d097b3 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -810,11 +810,13 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
810 | tunnel->err_count = 0; | 810 | tunnel->err_count = 0; |
811 | } | 811 | } |
812 | 812 | ||
813 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen; | 813 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->u.dst.header_len; |
814 | 814 | ||
815 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| | 815 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| |
816 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { | 816 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { |
817 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); | 817 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); |
818 | if (max_headroom > dev->needed_headroom) | ||
819 | dev->needed_headroom = max_headroom; | ||
818 | if (!new_skb) { | 820 | if (!new_skb) { |
819 | ip_rt_put(rt); | 821 | ip_rt_put(rt); |
820 | txq->tx_dropped++; | 822 | txq->tx_dropped++; |