diff mbox

[RFC] xfrm: Don't queue retransmitted packets if the original is still on the host

Message ID 20131016114246.GB7660@secunet.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Steffen Klassert Oct. 16, 2013, 11:42 a.m. UTC
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>
---
 net/xfrm/xfrm_policy.c |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

David Miller Oct. 18, 2013, 8:19 p.m. UTC | #1
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Wed, 16 Oct 2013 13:42:47 +0200

> 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>

I have no problems with this, what about you Eric?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Dumazet Oct. 18, 2013, 8:23 p.m. UTC | #2
On Fri, 2013-10-18 at 16:19 -0400, David Miller wrote:
> From: Steffen Klassert <steffen.klassert@secunet.com>
> Date: Wed, 16 Oct 2013 13:42:47 +0200
> 
> > 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>
> 
> I have no problems with this, what about you Eric?

It looks fine to me.

Acked-by: Eric Dumazet <edumazet@google.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 18, 2013, 8:34 p.m. UTC | #3
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 18 Oct 2013 13:23:45 -0700

> On Fri, 2013-10-18 at 16:19 -0400, David Miller wrote:
>> From: Steffen Klassert <steffen.klassert@secunet.com>
>> Date: Wed, 16 Oct 2013 13:42:47 +0200
>> 
>> > 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>
>> 
>> I have no problems with this, what about you Eric?
> 
> It looks fine to me.
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Great, Steffen I assume you'll merge this in via your ipsec tree.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steffen Klassert Oct. 21, 2013, 2:51 p.m. UTC | #4
On Fri, Oct 18, 2013 at 04:34:12PM -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Fri, 18 Oct 2013 13:23:45 -0700
> 
> > On Fri, 2013-10-18 at 16:19 -0400, David Miller wrote:
> >> From: Steffen Klassert <steffen.klassert@secunet.com>
> >> Date: Wed, 16 Oct 2013 13:42:47 +0200
> >> 
> >> > 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>
> >> 
> >> I have no problems with this, what about you Eric?
> > 
> > It looks fine to me.
> > 
> > Acked-by: Eric Dumazet <edumazet@google.com>
> 
> Great, Steffen I assume you'll merge this in via your ipsec tree.

Now applied to the ipsec-next tree. Thanks everyone for the review!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index ed38d5d..e09edfc 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);