netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter/IPv6:  fix DSCP mangle code
@ 2011-04-22  7:02 Fernando Luis Vazquez Cao
  2011-04-22  7:08 ` David Miller
  2011-04-22  7:19 ` [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module Fernando Luis Vazquez Cao
  0 siblings, 2 replies; 20+ messages in thread
From: Fernando Luis Vazquez Cao @ 2011-04-22  7:02 UTC (permalink / raw)
  To: netdev; +Cc: davem, yoshfuji, jengelh

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>
---

diff -urNp linux-2.6.37-orig/net/netfilter/xt_DSCP.c linux-2.6.37/net/netfilter/xt_DSCP.c
--- linux-2.6.37-orig/net/netfilter/xt_DSCP.c	2011-01-05 09:50:19.000000000 +0900
+++ linux-2.6.37/net/netfilter/xt_DSCP.c	2011-04-21 16:01:25.801890733 +0900
@@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struc
 	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)))



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-05-06 10:45 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-22  7:02 [PATCH] netfilter/IPv6: fix DSCP mangle code Fernando Luis Vazquez Cao
2011-04-22  7:08 ` David Miller
2011-04-22  7:29   ` Fernando Luis Vazquez Cao
2011-04-22  7:19 ` [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module Fernando Luis Vazquez Cao
2011-04-22  7:34   ` Eric Dumazet
2011-04-22  7:47     ` Fernando Luis Vazquez Cao
2011-04-22  8:06       ` Eric Dumazet
2011-04-22  8:11         ` Fernando Luis Vazquez Cao
2011-04-22  8:37           ` Eric Dumazet
2011-04-26  1:13             ` Pablo Neira Ayuso
2011-04-26  1:26               ` Fernando Luis Vazquez Cao
2011-04-26  5:17                 ` David Miller
2011-04-26  5:25                   ` Fernando Luis Vazquez Cao
2011-04-26 15:34                     ` Pablo Neira Ayuso
2011-04-26 15:35                       ` Pablo Neira Ayuso
2011-04-27  4:21                         ` Fernando Luis Vazquez Cao
2011-05-06  8:27                       ` Fernando Luis Vázquez Cao
2011-05-06 10:38                         ` Pablo Neira Ayuso
2011-05-06 10:45                           ` Jan Engelhardt
2011-04-26  5:17               ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).