netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
@ 2013-01-22 21:20 Pravin B Shelar
  2013-01-22 21:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pravin B Shelar @ 2013-01-22 21:20 UTC (permalink / raw)
  To: netdev; +Cc: jesse, Pravin B Shelar

Due to 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.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 net/ipv4/ip_gre.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 303012a..7cdf1fe 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -964,7 +964,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
 		}
 		if (tunnel->parms.o_flags&GRE_CSUM) {
 			*ptr = 0;
-			*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
+			*(__sum16 *)ptr = csum_fold(skb_checksum(skb,
+						skb_transport_offset(skb),
+						skb->len - skb_transport_offset(skb),
+						0));
 		}
 	}
 
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
  2013-01-22 21:20 [PATCH 1/2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Pravin B Shelar
@ 2013-01-22 21:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-22 21:25 UTC (permalink / raw)
  To: pshelar; +Cc: netdev, jesse

From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 22 Jan 2013 13:20:36 -0800

> -			*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
> +			*(__sum16 *)ptr = csum_fold(skb_checksum(skb,
> +						skb_transport_offset(skb),
> +						skb->len - skb_transport_offset(skb),
> +						0));

This is not the correct way to indent a multi-line function call.

The second and subsequent lines should be indented by a combination of
TAB and space characters, as needed, to make the first non-space
character line up with the first column after the openning parenthesis
of the first line.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-22 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 21:20 [PATCH 1/2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Pravin B Shelar
2013-01-22 21:25 ` David Miller

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).