[ovs-dev] [PATCH 2/5] compat: nf_defrag_ipv6: avoid/free clone operations.

Jesse Gross jesse at kernel.org
Wed Apr 27 02:44:07 UTC 2016


On Thu, Apr 21, 2016 at 2:07 PM, Joe Stringer <joe at ovn.org> wrote:
> diff --git a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
> index fe99ced37227..a3b86dab2c9c 100644
> --- a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
> +++ b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
> @@ -16,17 +16,17 @@
>  #define OVS_NF_DEFRAG6_BACKPORT 1
>  struct sk_buff *rpl_nf_ct_frag6_gather(struct net *net, struct sk_buff *skb,
>                                        u32 user);
> +#define nf_ct_frag6_gather rpl_nf_ct_frag6_gather
> +#endif /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */
> +
> +#ifdef OVS_NF_DEFRAG6_BACKPORT
>  int __init rpl_nf_ct_frag6_init(void);
>  void rpl_nf_ct_frag6_cleanup(void);
> -void rpl_nf_ct_frag6_consume_orig(struct sk_buff *skb);
> -#define nf_ct_frag6_gather rpl_nf_ct_frag6_gather
> -#else /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */
> +#else /* !OVS_NF_DEFRAG6_BACKPORT */
>  static inline int __init rpl_nf_ct_frag6_init(void) { return 0; }
>  static inline void rpl_nf_ct_frag6_cleanup(void) { }
> -static inline void rpl_nf_ct_frag6_consume_orig(struct sk_buff *skb) { }
> -#endif /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */
> +#endif /* OVS_NF_DEFRAG6_BACKPORT */
>  #define nf_ct_frag6_init rpl_nf_ct_frag6_init
>  #define nf_ct_frag6_cleanup rpl_nf_ct_frag6_cleanup
> -#define nf_ct_frag6_consume_orig rpl_nf_ct_frag6_consume_orig

I'm not sure that I totally understand what is going on in this file.
In particular, although not directly related to this patch, I'm not
sure why we define rpl_nf_ct_frag6_init()/cleanup() to be no-ops in
cases where we don't have OVS_NF_DEFRAG6_BACKPORT. On new kernels,
shouldn't we be using the upstream definitions of these functions? The
values initialized seem to be used by functions which aren't
backported.

More minor but it also seems odd that rpl_nf_ct_frag6_gather() is
declared in the first #ifdef but then actually defined under
OVS_NF_DEFRAG6_BACKPORT like all of the other functions. What's the
reason for separating it out this way?



More information about the dev mailing list