Skip to content

Commit

Permalink
compat: Document nf_defrag_ipv[46] backport.
Browse files Browse the repository at this point in the history
Document how the IP(6) defrag backport works, and do minor style cleanups.

Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Jesse Gross <[email protected]>
  • Loading branch information
joestringer committed May 3, 2016
1 parent a3a68d6 commit 9323abe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions datapath/linux/compat/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb,
#define ip_do_fragment rpl_ip_do_fragment
#endif /* IP_DO_FRAGMENT */

/* If backporting IP defrag, then init/exit functions need to be called from
* compat_{in,ex}it() to prepare the backported fragmentation cache. In this
* case we declare the functions which are defined in
* datapath/linux/compat/ip_fragment.c. */
int rpl_ip_defrag(struct net *net, struct sk_buff *skb, u32 user);
#define ip_defrag rpl_ip_defrag
int __init rpl_ipfrag_init(void);
Expand All @@ -139,6 +143,9 @@ static inline int rpl_ip_defrag(struct net *net, struct sk_buff *skb, u32 user)
#define ip_defrag rpl_ip_defrag
#endif

/* If we can use upstream defrag then we can rely on the upstream
* defrag module to init/exit correctly. In this case the calls in
* compat_{in,ex}it() can be no-ops. */
static inline int rpl_ipfrag_init(void) { return 0; }
static inline void rpl_ipfrag_fini(void) { }
#endif /* HAVE_CORRECT_MRU_HANDLING */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@
#define OVS_NF_DEFRAG6_BACKPORT 1
int 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
/* If backporting IPv6 defrag, then init/exit functions need to be called from
* compat_{in,ex}it() to prepare the backported fragmentation cache. In this
* case we declare the functions which are defined in
* datapath/linux/compat/nf_conntrack_reasm.c.
*
* Otherwise, if we can use upstream defrag then we can rely on the upstream
* nf_defrag_ipv6 module to init/exit correctly. In this case the calls in
* compat_{in,ex}it() can be no-ops.
*/
int __init rpl_nf_ct_frag6_init(void);
void rpl_nf_ct_frag6_cleanup(void);
#else /* !OVS_NF_DEFRAG6_BACKPORT */
Expand Down

0 comments on commit 9323abe

Please sign in to comment.