summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2013-10-16 13:42:46 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2013-10-21 09:45:20 +0200
commit4d53eff48b5f03ce67f4f301d6acca1d2145cb7a (patch)
tree57a9f7eb1bf14672f132a834de67997796dfd81f
parent5cf4eb54c2dcae681279a9cfca5498cfe65c5384 (diff)
downloadlwn-4d53eff48b5f03ce67f4f301d6acca1d2145cb7a.tar.gz
lwn-4d53eff48b5f03ce67f4f301d6acca1d2145cb7a.zip
xfrm: Don't queue retransmitted packets if the original is still on the host
It does not make sense to queue retransmitted packets if the original packet is still in some queue of this host. So add a check to xdst_queue_output() and drop the packet if the original packet is not yet sent. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Eric Dumazet <edumazet@google.com>
-rw-r--r--net/xfrm/xfrm_policy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index ed38d5d81f9e..e09edfcf1b79 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1832,6 +1832,13 @@ static int xdst_queue_output(struct sk_buff *skb)
struct dst_entry *dst = skb_dst(skb);
struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
struct xfrm_policy_queue *pq = &xdst->pols[0]->polq;
+ const struct sk_buff *fclone = skb + 1;
+
+ if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
+ fclone->fclone == SKB_FCLONE_CLONE)) {
+ kfree_skb(skb);
+ return 0;
+ }
if (pq->hold_queue.qlen > XFRM_MAX_QUEUE_LEN) {
kfree_skb(skb);