Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Paolo Abeni and committed by
David S. Miller
c43c3d76 197dbf24

+10 -10
+10
include/net/ip_fib.h
··· 311 311 return err; 312 312 } 313 313 314 + static inline bool fib4_has_custom_rules(const struct net *net) 315 + { 316 + return false; 317 + } 318 + 314 319 static inline bool fib4_rule_default(const struct fib_rule *rule) 315 320 { 316 321 return true; ··· 381 376 rcu_read_unlock(); 382 377 383 378 return err; 379 + } 380 + 381 + static inline bool fib4_has_custom_rules(const struct net *net) 382 + { 383 + return net->ipv4.fib_has_custom_rules; 384 384 } 385 385 386 386 bool fib4_rule_default(const struct fib_rule *rule);
-10
net/ipv4/fib_frontend.c
··· 70 70 fib_free_table(main_table); 71 71 return -ENOMEM; 72 72 } 73 - 74 - static bool fib4_has_custom_rules(struct net *net) 75 - { 76 - return false; 77 - } 78 73 #else 79 74 80 75 struct fib_table *fib_new_table(struct net *net, u32 id) ··· 125 130 return tb; 126 131 } 127 132 return NULL; 128 - } 129 - 130 - static bool fib4_has_custom_rules(struct net *net) 131 - { 132 - return net->ipv4.fib_has_custom_rules; 133 133 } 134 134 #endif /* CONFIG_IP_MULTIPLE_TABLES */ 135 135