netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>,
	Netdev Mailing List <netdev@vger.kernel.org>
Subject: [IPV6]: Fix routing by fwmark
Date: Sat, 26 Aug 2006 13:11:26 +0200	[thread overview]
Message-ID: <44F02C5E.3070701@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1252 bytes --]

[IPV6]: Fix routing by fwmark

Fix mark comparison, also dump the mask to userspace when the mask is zero,
but the mark is not (in which case the mark is dumped, so the mask is needed
to make sense of it).

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 829b107d9e4ef2bbbf2ccf25a748235739e9231e
tree 4ca98fb79f3e5e9cb0175ad9c074d9e4447735ac
parent 6963696ada0c98c53c2d59ca66944adb4d13e3a5
author Patrick McHardy <kaber@trash.net> Sat, 26 Aug 2006 13:12:32 +0200
committer Patrick McHardy <kaber@trash.net> Sat, 26 Aug 2006 13:12:32 +0200

 net/ipv6/fib6_rules.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index ee4aa43..2fbc71d 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -129,7 +129,7 @@ static int fib6_rule_match(struct fib_ru
 		return 0;
 
 #ifdef CONFIG_IPV6_ROUTE_FWMARK
-	if ((r->fwmark ^ fl->fl6_fwmark) / r->fwmask)
+	if ((r->fwmark ^ fl->fl6_fwmark) & r->fwmask)
 		return 0;
 #endif
 
@@ -256,7 +256,7 @@ #ifdef CONFIG_IPV6_ROUTE_FWMARK
 	if (rule6->fwmark)
 		NLA_PUT_U32(skb, FRA_FWMARK, rule6->fwmark);
 
-	if (rule6->fwmask)
+	if (rule6->fwmask || rule6->fwmark)
 		NLA_PUT_U32(skb, FRA_FWMASK, rule6->fwmask);
 #endif
 

             reply	other threads:[~2006-08-26 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26 11:11 Patrick McHardy [this message]
2006-08-26 11:39 ` [IPV6]: Fix routing by fwmark YOSHIFUJI Hideaki / 吉藤英明
2006-08-26 23:50 ` 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=44F02C5E.3070701@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).