Skip to content

Commit

Permalink
netfilter: IPv6: fix DSCP mangle code
Browse files Browse the repository at this point in the history
The mask indicates the bits one wants to zero out, so it needs to be
inverted before applying to the original TOS field.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Fernando Luis Vazquez Cao authored and Pablo Neira Ayuso committed May 10, 2011
1 parent 4319cc0 commit 1ed2f73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_DSCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struct xt_action_param *par)
u_int8_t orig, nv;

orig = ipv6_get_dsfield(iph);
nv = (orig & info->tos_mask) ^ info->tos_value;
nv = (orig & ~info->tos_mask) ^ info->tos_value;

if (orig != nv) {
if (!skb_make_writable(skb, sizeof(struct iphdr)))
Expand Down

0 comments on commit 1ed2f73

Please sign in to comment.