diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-26 19:50:20 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:18:14 -0400 |
commit | 366e4adc0f9ef33f56c62f980a7d83775e64abd0 (patch) | |
tree | 66a33db0eb110e75c55e906de27b6693b42e7efa /net | |
parent | 74975d40b16fd4bad24a2e2630dc7957d8cba013 (diff) |
[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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | 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 ee4aa43ad973..2fbc71d90187 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -129,7 +129,7 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | |||
129 | return 0; | 129 | return 0; |
130 | 130 | ||
131 | #ifdef CONFIG_IPV6_ROUTE_FWMARK | 131 | #ifdef CONFIG_IPV6_ROUTE_FWMARK |
132 | if ((r->fwmark ^ fl->fl6_fwmark) / r->fwmask) | 132 | if ((r->fwmark ^ fl->fl6_fwmark) & r->fwmask) |
133 | return 0; | 133 | return 0; |
134 | #endif | 134 | #endif |
135 | 135 | ||
@@ -256,7 +256,7 @@ static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb, | |||
256 | if (rule6->fwmark) | 256 | if (rule6->fwmark) |
257 | NLA_PUT_U32(skb, FRA_FWMARK, rule6->fwmark); | 257 | NLA_PUT_U32(skb, FRA_FWMARK, rule6->fwmark); |
258 | 258 | ||
259 | if (rule6->fwmask) | 259 | if (rule6->fwmask || rule6->fwmark) |
260 | NLA_PUT_U32(skb, FRA_FWMASK, rule6->fwmask); | 260 | NLA_PUT_U32(skb, FRA_FWMASK, rule6->fwmask); |
261 | #endif | 261 | #endif |
262 | 262 | ||