From: Paolo Abeni Date: Wed, 20 Nov 2019 12:47:33 +0000 (+0100) Subject: ipv6: add fib6_has_custom_rules() helper X-Git-Tag: v5.15~5092^2~33^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f8ac5703037fdd2e6c960cd35c2b14d18ef3933;p=platform%2Fkernel%2Flinux-starfive.git 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 Suggested-by: Eric Dumazet Signed-off-by: Paolo Abeni Reviewed-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 5d16154..8ac3a59 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -502,6 +502,11 @@ static inline bool fib6_metric_locked(struct fib6_info *f6i, int metric) } #ifdef CONFIG_IPV6_MULTIPLE_TABLES +static inline bool fib6_has_custom_rules(const struct net *net) +{ + return net->ipv6.fib6_has_custom_rules; +} + int fib6_rules_init(void); void fib6_rules_cleanup(void); bool fib6_rule_default(const struct fib_rule *rule); @@ -527,6 +532,10 @@ static inline bool fib6_rules_early_flow_dissect(struct net *net, return true; } #else +static inline bool fib6_has_custom_rules(const struct net *net) +{ + return false; +} static inline int fib6_rules_init(void) { return 0;