Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ed2f73d authored by Fernando Luis Vazquez Cao's avatar Fernando Luis Vazquez Cao Committed by Pablo Neira Ayuso
Browse files

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: default avatarFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4319cc0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struct xt_action_param *par)
	u_int8_t orig, nv;
	u_int8_t orig, nv;


	orig = ipv6_get_dsfield(iph);
	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 (orig != nv) {
		if (!skb_make_writable(skb, sizeof(struct iphdr)))
		if (!skb_make_writable(skb, sizeof(struct iphdr)))