diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-01-23 06:45:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-28 00:07:34 -0500 |
commit | 5465740ace36f179de5bb0ccb5d46ddeb945e309 (patch) | |
tree | fcb6e76c41c72c45f985583172e4c09b48c446b1 /net | |
parent | 9839ff0dead906e85e4d17490aeff87a5859a157 (diff) |
IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
Due to IP_GRE GSO support, GRE can recieve non linear skb which
results in panic in case of GRE_CSUM. Following patch fixes it by
using correct csum API.
Bug introduced in commit 6b78f16e4bdde3936b (gre: add GSO support)
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_gre.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 303012adf9e6..e81b1caf2ea2 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -963,8 +963,12 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
963 | ptr--; | 963 | ptr--; |
964 | } | 964 | } |
965 | if (tunnel->parms.o_flags&GRE_CSUM) { | 965 | if (tunnel->parms.o_flags&GRE_CSUM) { |
966 | int offset = skb_transport_offset(skb); | ||
967 | |||
966 | *ptr = 0; | 968 | *ptr = 0; |
967 | *(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr)); | 969 | *(__sum16 *)ptr = csum_fold(skb_checksum(skb, offset, |
970 | skb->len - offset, | ||
971 | 0)); | ||
968 | } | 972 | } |
969 | } | 973 | } |
970 | 974 | ||