summaryrefslogtreecommitdiffstats
path: root/include/net/ip_fib.h
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2019-11-20 13:47:36 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-21 14:45:55 -0800
commitc43c3d76c021d8d654ff5cfaad381f14f6beaf1a (patch)
tree168162cd9d5f129d1c1bc922bdae8406cfaab0ef /include/net/ip_fib.h
parent197dbf24e360ed8dbbbe8ed17c2c496f501a0bda (diff)
downloadlinux-c43c3d76c021d8d654ff5cfaad381f14f6beaf1a.tar.bz2
ipv4: move fib4_has_custom_rules() helper to public header
So that we can use it in the next patch. Additionally constify the helper argument. Suggested-by: David Ahern <dsahern@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>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r--include/net/ip_fib.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 52b2406a5dfc..b9cba41c6d4f 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -311,6 +311,11 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
return err;
}
+static inline bool fib4_has_custom_rules(const struct net *net)
+{
+ return false;
+}
+
static inline bool fib4_rule_default(const struct fib_rule *rule)
{
return true;
@@ -378,6 +383,11 @@ out:
return err;
}
+static inline bool fib4_has_custom_rules(const struct net *net)
+{
+ return net->ipv4.fib_has_custom_rules;
+}
+
bool fib4_rule_default(const struct fib_rule *rule);
int fib4_rules_dump(struct net *net, struct notifier_block *nb,
struct netlink_ext_ack *extack);