Skip to content

Commit

Permalink
netfilter: IPv6: fix DSCP mangle code
Browse files Browse the repository at this point in the history
commit 1ed2f73 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Fernando Luis Vazquez Cao authored and Greg Kroah-Hartman committed Jun 23, 2011
1 parent fd1aa48 commit 3f6c255
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_target_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 3f6c255

Please sign in to comment.