[ovs-dev] [PATCH 2/3] gre: Check vswitch_skb_checksum_setup() return code.

Jesse Gross jesse at nicira.com
Thu Jun 17 23:27:30 UTC 2010


If vswitch_skb_checksum_setup() returns an error, the checksum
pointers probably haven't been set correctly which could cause
a crash later.  We should give up immediately on error.
---
 datapath/vport-gre.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 98e0abc..c71cc34 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -1131,7 +1131,9 @@ gre_send(struct vport *vport, struct sk_buff *skb)
 	}
 
 	forward_ip_summed(skb);
-	vswitch_skb_checksum_setup(skb);
+
+	if (unlikely(vswitch_skb_checksum_setup(skb)))
+		goto error_free;
 
 	skb = handle_gso(skb);
 	if (unlikely(IS_ERR(skb))) {
-- 
1.7.0.4





More information about the dev mailing list