Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: IPv6: fix DSCP mangle code

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>

authored by

Fernando Luis Vazquez Cao and committed by
Pablo Neira Ayuso
1ed2f73d 4319cc0c

+1 -1
+1 -1
net/netfilter/xt_DSCP.c
··· 99 99 u_int8_t orig, nv; 100 100 101 101 orig = ipv6_get_dsfield(iph); 102 - nv = (orig & info->tos_mask) ^ info->tos_value; 102 + nv = (orig & ~info->tos_mask) ^ info->tos_value; 103 103 104 104 if (orig != nv) { 105 105 if (!skb_make_writable(skb, sizeof(struct iphdr)))