public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, jengelh@medozas.de
Subject: [PATCH] netfilter/IPv6:  fix DSCP mangle code
Date: Fri, 22 Apr 2011 16:02:39 +0900	[thread overview]
Message-ID: <1303455759.2023.39.camel@nausicaa> (raw)

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



             reply	other threads:[~2011-04-22  7:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  7:02 Fernando Luis Vazquez Cao [this message]
2011-04-22  7:08 ` [PATCH] netfilter/IPv6: fix DSCP mangle code 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303455759.2023.39.camel@nausicaa \
    --to=fernando@oss.ntt.co.jp \
    --cc=davem@davemloft.net \
    --cc=jengelh@medozas.de \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox