From: Jean Tourrilhes Date: Thu, 9 Dec 2010 06:05:07 +0000 (-0800) Subject: dpif-netdev: Handle ECN bits when updating IP checksum. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d785a24216d946fcce1c351e5d978043e14cbe2;p=openvswitch dpif-netdev: Handle ECN bits when updating IP checksum. When recalculating the checksum after a set ToS action, we were not taking into account the ECN bits copied from the original header. --- diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index eddd18be..3fa681c9 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1089,7 +1089,7 @@ dp_netdev_set_nw_tos(struct ofpbuf *packet, struct flow *key, uint8_t new = a->nw_tos | (nh->ip_tos & IP_ECN_MASK); nh->ip_csum = recalc_csum16(nh->ip_csum, htons((uint16_t)*field), - htons((uint16_t)a->nw_tos)); + htons((uint16_t) new)); *field = new; } }