Commit 8b6956 (datapath: Correctly update IP checksum with actions.)
introduced an issue that caused the checksum to not be properly
calculated on little endian systems when updating the IP TOS field.
This commit fixes the issue.

Signed-off-by: Justin Pettit <jpet...@nicira.com>
---
 datapath/actions.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index b5b92ba..efe5e98 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -158,8 +158,8 @@ static void set_ip_tos(struct sk_buff *skb, struct iphdr 
*nh, u8 new_tos)
        /* Set the DSCP bits and preserve the ECN bits. */
        old = nh->tos;
        new = new_tos | (nh->tos & INET_ECN_MASK);
-       csum_replace4(&nh->check, (__force __be32)old,
-                                 (__force __be32)new);
+       csum_replace4(&nh->check, (__force __be32)htons(old),
+                                 (__force __be32)htons(new));
        nh->tos = new;
 }
 
-- 
1.7.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to