Skip to content

Commit 1f8ac57

Browse files
Paolo Abenidavem330
authored andcommitted
ipv6: add fib6_has_custom_rules() helper
It wraps the namespace field with the same name, to easily access it regardless of build options. Suggested-by: David Ahern <dsahern@gmail.com> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2c44713 commit 1f8ac57

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/net/ip6_fib.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,11 @@ static inline bool fib6_metric_locked(struct fib6_info *f6i, int metric)
502502
}
503503

504504
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
505+
static inline bool fib6_has_custom_rules(const struct net *net)
506+
{
507+
return net->ipv6.fib6_has_custom_rules;
508+
}
509+
505510
int fib6_rules_init(void);
506511
void fib6_rules_cleanup(void);
507512
bool fib6_rule_default(const struct fib_rule *rule);
@@ -527,6 +532,10 @@ static inline bool fib6_rules_early_flow_dissect(struct net *net,
527532
return true;
528533
}
529534
#else
535+
static inline bool fib6_has_custom_rules(const struct net *net)
536+
{
537+
return false;
538+
}
530539
static inline int fib6_rules_init(void)
531540
{
532541
return 0;

0 commit comments

Comments
 (0)