X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=d576c7350cbf541f6ff3297d09f73e3476958e0b;hb=776fb430bfbc575c16c4db3be7ffdeb507325a6a;hp=54fff5e1807d139e7ae1f74ab72a16494cf9ca30;hpb=3c85d3d0e7a5ce7692aaf7230d84070c49d9ce92;p=sliver-openvswitch.git diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 54fff5e18..d576c7350 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1180,8 +1180,8 @@ dp_netdev_set_nw_tos(struct ofpbuf *packet, flow_t *key, struct ip_header *nh = packet->l3; uint8_t *field = &nh->ip_tos; - /* We only set the lower 6 bits. */ - uint8_t new = (a->nw_tos & 0x3f) | (nh->ip_tos & 0xc0); + /* Set the DSCP bits and preserve the ECN bits. */ + uint8_t new = (a->nw_tos & IP_DSCP_MASK) | (nh->ip_tos & IP_ECN_MASK); nh->ip_csum = recalc_csum16(nh->ip_csum, htons((uint16_t)*field), htons((uint16_t)a->nw_tos));