From: wenxu <we...@ucloud.cn>

Add ipv6_fragment to ipv6_stub to avoid calling netfilter when
access ip6_fragment.

Signed-off-by: wenxu <we...@ucloud.cn>
---
 include/net/ipv6_stubs.h | 3 +++
 net/ipv6/af_inet6.c      | 1 +
 2 files changed, 4 insertions(+)

diff --git a/include/net/ipv6_stubs.h b/include/net/ipv6_stubs.h
index d7a7f7c..8fce558 100644
--- a/include/net/ipv6_stubs.h
+++ b/include/net/ipv6_stubs.h
@@ -63,6 +63,9 @@ struct ipv6_stub {
                               int encap_type);
 #endif
        struct neigh_table *nd_tbl;
+
+       int (*ipv6_fragment)(struct net *net, struct sock *sk, struct sk_buff 
*skb,
+                            int (*output)(struct net *, struct sock *, struct 
sk_buff *));
 };
 extern const struct ipv6_stub *ipv6_stub __read_mostly;
 
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index d9a1493..e648fbe 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1027,6 +1027,7 @@ static int ipv6_route_input(struct sk_buff *skb)
        .xfrm6_rcv_encap = xfrm6_rcv_encap,
 #endif
        .nd_tbl = &nd_tbl,
+       .ipv6_fragment = ip6_fragment,
 };
 
 static const struct ipv6_bpf_stub ipv6_bpf_stub_impl = {
-- 
1.8.3.1

Reply via email to