aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/netfilter_ipv6.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-03-27 09:22:25 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-04-08 23:01:42 +0200
commitc1deb065cf3b5bcd483e3f03479f930edb151b99 (patch)
tree2fd53ec6848c117a9b56e26842e425236832e3bb /include/linux/netfilter_ipv6.h
parentnetfilter: nat: add inet family nat support (diff)
downloadwireguard-linux-c1deb065cf3b5bcd483e3f03479f930edb151b99.tar.xz
wireguard-linux-c1deb065cf3b5bcd483e3f03479f930edb151b99.zip
netfilter: nf_tables: merge route type into core
very little code, so it really doesn't make sense to have extra modules or even a kconfig knob for this. Merge them and make functionality available unconditionally. The merge makes inet family route support trivial, so add it as well here. Before: text data bss dec hex filename 835 832 0 1667 683 nft_chain_route_ipv4.ko 870 832 0 1702 6a6 nft_chain_route_ipv6.ko 111568 2556 529 114653 1bfdd nf_tables.ko After: text data bss dec hex filename 113133 2556 529 116218 1c5fa nf_tables.ko Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux/netfilter_ipv6.h')
-rw-r--r--include/linux/netfilter_ipv6.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 471e9467105b..12113e502656 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -87,6 +87,21 @@ static inline int nf_ip6_route(struct net *net, struct dst_entry **dst,
}
int ip6_route_me_harder(struct net *net, struct sk_buff *skb);
+
+static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb)
+{
+#if IS_MODULE(CONFIG_IPV6)
+ const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
+
+ if (!v6_ops)
+ return -EHOSTUNREACH;
+
+ return v6_ops->route_me_harder(net, skb);
+#else
+ return ip6_route_me_harder(net, skb);
+#endif
+}
+
__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
unsigned int dataoff, u_int8_t protocol);