Skip to content

Commit

Permalink
ipv4: move fib4_has_custom_rules() helper to public header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paolo Abeni authored and davem330 committed Nov 21, 2019
1 parent 197dbf2 commit c43c3d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions include/net/ip_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -378,6 +383,11 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
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);
Expand Down
10 changes: 0 additions & 10 deletions net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ static int __net_init fib4_rules_init(struct net *net)
fib_free_table(main_table);
return -ENOMEM;
}

static bool fib4_has_custom_rules(struct net *net)
{
return false;
}
#else

struct fib_table *fib_new_table(struct net *net, u32 id)
Expand Down Expand Up @@ -131,11 +126,6 @@ struct fib_table *fib_get_table(struct net *net, u32 id)
}
return NULL;
}

static bool fib4_has_custom_rules(struct net *net)
{
return net->ipv4.fib_has_custom_rules;
}
#endif /* CONFIG_IP_MULTIPLE_TABLES */

static void fib_replace_table(struct net *net, struct fib_table *old,
Expand Down

0 comments on commit c43c3d7

Please sign in to comment.