In kernels <=3.16 there is an LRU for managing fragment queues for IPv4
and IPv6. Because the backport code comes from more recent upstream
versions of Linux, this LRU management was missing from ip_frag_queue()
and nf_ct_frag6_queue().
Fixes: 595e069a0634 ("compat: Backport IPv4 reassembly.")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
[rwlock])
OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_queue],
[list_evictor])
+ OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_lru_move])
OVS_GREP_IFELSE([$KSRC/include/net/inetpeer.h], [vif],
[OVS_DEFINE([HAVE_INETPEER_VIF_SUPPORT])])
}
#endif /* HAVE_INET_FRAG_EVICTING */
+/* Upstream commit 3fd588eb90bf ("inet: frag: remove lru list") dropped this
+ * function, but we call it from our compat code. Provide a noop version. */
+#ifndef HAVE_INET_FRAG_LRU_MOVE
+#define inet_frag_lru_move(q)
+#endif
+
#ifndef HAVE_CORRECT_MRU_HANDLING
static inline void rpl_sub_frag_mem_limit(struct netns_frags *nf, int i)
{
}
skb_dst_drop(skb);
+ inet_frag_lru_move(&qp->q);
return -EINPROGRESS;
err:
qp_flags(fq) |= INET_FRAG_FIRST_IN;
}
+ inet_frag_lru_move(&fq->q);
return 0;
discard_fq: