diff options
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r-- | net/ipv6/fib6_rules.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 2e1a432867c0..e64e6a55fc4a 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -111,6 +111,18 @@ out: | |||
111 | return rt == NULL ? -EAGAIN : 0; | 111 | return rt == NULL ? -EAGAIN : 0; |
112 | } | 112 | } |
113 | 113 | ||
114 | static bool fib6_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg) | ||
115 | { | ||
116 | struct rt6_info *rt = (struct rt6_info *) arg->result; | ||
117 | /* do not accept result if the route does | ||
118 | * not meet the required prefix length | ||
119 | */ | ||
120 | if (rt->rt6i_dst.plen < rule->table_prefixlen_min) { | ||
121 | ip6_rt_put(rt); | ||
122 | return true; | ||
123 | } | ||
124 | return false; | ||
125 | } | ||
114 | 126 | ||
115 | static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | 127 | static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) |
116 | { | 128 | { |
@@ -244,6 +256,7 @@ static const struct fib_rules_ops __net_initconst fib6_rules_ops_template = { | |||
244 | .addr_size = sizeof(struct in6_addr), | 256 | .addr_size = sizeof(struct in6_addr), |
245 | .action = fib6_rule_action, | 257 | .action = fib6_rule_action, |
246 | .match = fib6_rule_match, | 258 | .match = fib6_rule_match, |
259 | .suppress = fib6_rule_suppress, | ||
247 | .configure = fib6_rule_configure, | 260 | .configure = fib6_rule_configure, |
248 | .compare = fib6_rule_compare, | 261 | .compare = fib6_rule_compare, |
249 | .fill = fib6_rule_fill, | 262 | .fill = fib6_rule_fill, |