aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-01-20 15:12:38 -0800
committerJesse Gross <jesse@nicira.com>2012-01-20 15:34:45 -0800
commit1fba445bdafea8318707991c4ac1edc3b2528690 (patch)
tree4d024a3340ae9dae131e59bf9d145e6a306fdd50
parentd80a55abae13fdee776114a4f2fd5fb29fea87f6 (diff)
datapath: Correct GRE checksum offset.
If a statically defined GRE key is used with checksums then the checksum will overwrite the key. This is because the key is set at header caching time and the checksum is set at packet processing time and we don't update the offset on packet processing because we don't do anything with the key. Reported-by: Christos Argyropoulos <cargious@netmode.ntua.gr> Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r--datapath/vport-gre.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 4411cac9..eb100091 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -101,10 +101,11 @@ static struct sk_buff *gre_update_header(const struct vport *vport,
- GRE_HEADER_SECTION);
/* Work backwards over the options so the checksum is last. */
- if (mutable->flags & TNL_F_OUT_KEY_ACTION) {
+ if (mutable->flags & TNL_F_OUT_KEY_ACTION)
*options = be64_get_low32(OVS_CB(skb)->tun_id);
+
+ if (mutable->out_key || mutable->flags & TNL_F_OUT_KEY_ACTION)
options--;
- }
if (mutable->flags & TNL_F_CSUM)
*(__sum16 *)options = csum_fold(skb_checksum(skb,