X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Factions.c;h=0aefb8d533d4bda811d1b305fc38b5c8cd30146b;hb=776fb430bfbc575c16c4db3be7ffdeb507325a6a;hp=3eea5323f11ee1e14171db31fd221932337cd276;hpb=3c85d3d0e7a5ce7692aaf7230d84070c49d9ce92;p=sliver-openvswitch.git diff --git a/datapath/actions.c b/datapath/actions.c index 3eea5323f..0aefb8d53 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -1,6 +1,6 @@ /* * Distributed under the terms of the GNU GPL version 2. - * Copyright (c) 2007, 2008, 2009 Nicira Networks. + * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks. * * Significant portions of this file may be copied from parts of the Linux * kernel, by Linus Torvalds and others. @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include "datapath.h" @@ -265,10 +266,10 @@ static struct sk_buff *set_nw_tos(struct sk_buff *skb, struct iphdr *nh = ip_hdr(skb); u8 *f = &nh->tos; u8 old = *f; + u8 new; - /* We only set the lower 6 bits. */ - u8 new = (a->nw_tos & 0x3f) | (nh->tos & 0xc0); - + /* Set the DSCP bits and preserve the ECN bits. */ + new = (a->nw_tos & ~INET_ECN_MASK) | (nh->tos & INET_ECN_MASK); update_csum(&nh->check, skb, htons((uint16_t)old), htons((uint16_t)new), 0); *f = new;