Skip to content

Commit

Permalink
tunnel: Add to nw_tos bits instead of replacing them in tnl_port_send().
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
blp committed Oct 23, 2014
1 parent 2c26eab commit cb85b49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cb85b49

Please sign in to comment.