netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
@ 2013-01-22 22:56 Pravin B Shelar
  2013-01-23  1:55 ` David Miller
  2013-01-23 14:00 ` YOSHIFUJI Hideaki
  0 siblings, 2 replies; 5+ messages in thread
From: Pravin B Shelar @ 2013-01-22 22:56 UTC (permalink / raw)
  To: netdev; +Cc: jesse, Pravin B Shelar

Fixed code indentation according to comments from David Miller.

--8<--------------------------cut here-------------------------->8--
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..8179e066 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] 5+ messages in thread

end of thread, other threads:[~2013-01-23 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 22:56 [PATCH v2] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Pravin B Shelar
2013-01-23  1:55 ` David Miller
2013-01-23  5:08   ` Ben Pfaff
2013-01-23  5:20     ` David Miller
2013-01-23 14:00 ` YOSHIFUJI Hideaki

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