datapath: Properly calculate checksum when updating TOS field.
[openvswitch] / datapath / actions.c
index b5b92ba8f5b5389882bc6a9d143feb74df71ef85..afd17914024bbba91575edf9bf047ec2f486d4e9 100644 (file)
@@ -158,8 +158,7 @@ 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_replace2(&nh->check, htons(old), htons(new));
        nh->tos = new;
 }