Skip to content

Commit c43c3d7

Browse files
Paolo Abenidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 197dbf2 commit c43c3d7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/net/ip_fib.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
311311
return err;
312312
}
313313

314+
static inline bool fib4_has_custom_rules(const struct net *net)
315+
{
316+
return false;
317+
}
318+
314319
static inline bool fib4_rule_default(const struct fib_rule *rule)
315320
{
316321
return true;
@@ -378,6 +383,11 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
378383
return err;
379384
}
380385

386+
static inline bool fib4_has_custom_rules(const struct net *net)
387+
{
388+
return net->ipv4.fib_has_custom_rules;
389+
}
390+
381391
bool fib4_rule_default(const struct fib_rule *rule);
382392
int fib4_rules_dump(struct net *net, struct notifier_block *nb,
383393
struct netlink_ext_ack *extack);

net/ipv4/fib_frontend.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ static int __net_init fib4_rules_init(struct net *net)
7070
fib_free_table(main_table);
7171
return -ENOMEM;
7272
}
73-
74-
static bool fib4_has_custom_rules(struct net *net)
75-
{
76-
return false;
77-
}
7873
#else
7974

8075
struct fib_table *fib_new_table(struct net *net, u32 id)
@@ -131,11 +126,6 @@ struct fib_table *fib_get_table(struct net *net, u32 id)
131126
}
132127
return NULL;
133128
}
134-
135-
static bool fib4_has_custom_rules(struct net *net)
136-
{
137-
return net->ipv4.fib_has_custom_rules;
138-
}
139129
#endif /* CONFIG_IP_MULTIPLE_TABLES */
140130

141131
static void fib_replace_table(struct net *net, struct fib_table *old,

0 commit comments

Comments
 (0)