aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/utils.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-02-02 10:17:00 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-02-04 18:21:12 +0100
commitac02bcf9cc1e4aefb0a7156a2ae26e8396b15f24 (patch)
treef18ef2303361b54f638b972bbef707018b7a346d /net/netfilter/utils.c
parentnetfilter: nat: remove module dependency on ipv6 core (diff)
downloadlinux-dev-ac02bcf9cc1e4aefb0a7156a2ae26e8396b15f24.tar.xz
linux-dev-ac02bcf9cc1e4aefb0a7156a2ae26e8396b15f24.zip
netfilter: ipv6: avoid indirect calls for IPV6=y case
indirect calls are only needed if ipv6 is a module. Add helpers to abstract the v6ops indirections and use them instead. fragment, reroute and route_input are kept as indirect calls. The first two are not not used in hot path and route_input is only used by bridge netfilter. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/utils.c')
-rw-r--r--net/netfilter/utils.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netfilter/utils.c b/net/netfilter/utils.c
index 55af9f247993..06dc55590441 100644
--- a/net/netfilter/utils.c
+++ b/net/netfilter/utils.c
@@ -162,7 +162,7 @@ EXPORT_SYMBOL_GPL(nf_checksum_partial);
int nf_route(struct net *net, struct dst_entry **dst, struct flowi *fl,
bool strict, unsigned short family)
{
- const struct nf_ipv6_ops *v6ops;
+ const struct nf_ipv6_ops *v6ops __maybe_unused;
int ret = 0;
switch (family) {
@@ -170,9 +170,7 @@ int nf_route(struct net *net, struct dst_entry **dst, struct flowi *fl,
ret = nf_ip_route(net, dst, fl, strict);
break;
case AF_INET6:
- v6ops = rcu_dereference(nf_ipv6_ops);
- if (v6ops)
- ret = v6ops->route(net, dst, fl, strict);
+ ret = nf_ip6_route(net, dst, fl, strict);
break;
}