[ovs-dev] [PATCH] tunnel: Add to nw_tos bits instead of replacing them in tnl_port_send().

Ben Pfaff blp at nicira.com
Wed Oct 22 21:58:08 UTC 2014


We normally only add 1-bits to wc->masks for datapath flow matching
purposes, never removing them.  In this case, the bits that get set to
zero will be set back to 1 later on in the function, so this does not fix
any actual bug, but the principle of only setting to 1, not to 0, seems
sound to me.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 ofproto/tunnel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
index 46b0719..a9eecff 100644
--- a/ofproto/tunnel.c
+++ b/ofproto/tunnel.c
@@ -405,7 +405,7 @@ tnl_port_send(const struct ofport_dpif *ofport, struct flow *flow,
     }
 
     if (cfg->tos_inherit && is_ip_any(flow)) {
-        wc->masks.nw_tos = IP_DSCP_MASK;
+        wc->masks.nw_tos |= IP_DSCP_MASK;
         flow->tunnel.ip_tos = flow->nw_tos & IP_DSCP_MASK;
     } else {
         flow->tunnel.ip_tos = cfg->tos;
-- 
1.7.10.4




More information about the dev mailing list