[IPV6]: Fix routing by fwmark

2006-08-26 Thread Patrick McHardy
[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 <[EMAIL PROTECTED]>

---
commit 829b107d9e4ef2bbbf2ccf25a748235739e9231e
tree 4ca98fb79f3e5e9cb0175ad9c074d9e4447735ac
parent 6963696ada0c98c53c2d59ca66944adb4d13e3a5
author Patrick McHardy <[EMAIL PROTECTED]> Sat, 26 Aug 2006 13:12:32 +0200
committer Patrick McHardy <[EMAIL PROTECTED]> 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
 


Re: [IPV6]: Fix routing by fwmark

2006-08-26 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Sat, 26 Aug 2006 13:11:26 +0200), Patrick 
McHardy <[EMAIL PROTECTED]> says:

> 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 <[EMAIL PROTECTED]>

What a shame... Thank you for catching this.

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [IPV6]: Fix routing by fwmark

2006-08-26 Thread David Miller

Applied, thanks Patrick.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html