Skip to content

Commit

Permalink
xfrm: Don't queue retransmitted packets if the original is still on t…
Browse files Browse the repository at this point in the history
…he 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>
  • Loading branch information
Steffen Klassert committed Oct 21, 2013
1 parent 5cf4eb5 commit 4d53eff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4d53eff

Please sign in to comment.