]>
Commit | Line | Data |
---|---|---|
2d3ef70b JS |
1 | #ifndef __NETFILTER_IPV6_WRAPPER_H |
2 | #define __NETFILTER_IPV6_WRAPPER_H 1 | |
3 | ||
4 | #include_next <linux/netfilter_ipv6.h> | |
5 | ||
6 | #include <linux/version.h> | |
7 | #include <net/ip.h> /* For OVS_VPORT_OUTPUT_PARAMS */ | |
8 | #include <net/ip6_route.h> | |
9 | ||
e4e04c3b | 10 | #ifndef HAVE_NF_IPV6_OPS_FRAGMENT |
2d3ef70b JS |
11 | /* Try to minimise changes required to the actions.c code for calling IPv6 |
12 | * fragmentation. We can keep the fragment() API mostly the same, except that | |
13 | * the callback parameter needs to be in the form that older kernels accept. | |
14 | * We don't backport the other ipv6_ops as they're currently unused by OVS. */ | |
15 | struct ovs_nf_ipv6_ops { | |
16 | int (*fragment)(struct sock *sk, struct sk_buff *skb, | |
17 | int (*output)(OVS_VPORT_OUTPUT_PARAMS)); | |
18 | }; | |
19 | #define nf_ipv6_ops ovs_nf_ipv6_ops | |
20 | ||
21 | #if defined(OVS_FRAGMENT_BACKPORT) | |
22 | static struct ovs_nf_ipv6_ops ovs_ipv6_ops = { | |
23 | .fragment = ip6_fragment, | |
24 | }; | |
25 | ||
26 | static inline struct ovs_nf_ipv6_ops *ovs_nf_get_ipv6_ops(void) | |
27 | { | |
28 | return &ovs_ipv6_ops; | |
29 | } | |
e4e04c3b | 30 | #else /* !OVS_FRAGMENT_BACKPORT */ |
2d3ef70b JS |
31 | static inline const struct ovs_nf_ipv6_ops *ovs_nf_get_ipv6_ops(void) |
32 | { | |
33 | return NULL; | |
34 | } | |
35 | #endif | |
36 | #define nf_get_ipv6_ops ovs_nf_get_ipv6_ops | |
37 | ||
e4e04c3b | 38 | #endif /* HAVE_NF_IPV6_OPS_FRAGMENT */ |
2d3ef70b | 39 | #endif /* __NETFILTER_IPV6_WRAPPER_H */ |