: Fix routing by fwmark
Subsystems (3)
[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).
---
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(-)
net/ipv6/fib6_rules.c +2 -2
@@ -129,7 +129,7 @@ static int fib6_rule_match(struct fib_rureturn 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_FWMARKif (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
In article <[email protected]> (at Sat, 26 Aug 2006 13:11:26 +0200), Patrick McHardy <[email protected]> says:
Quoted 5 lines
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
Applied, thanks Patrick.