Skip to contentSkip to conversation

tcp: consume packet after do time wait process

PATCH In review Jianguo Wu 2 participants 2 messages Mar 23, 2022

Subsystems (3)
lore
Share & tools
lore

Jianguo Wu

author
#0 lore raw

PATCH 1/1 tcp: consume packet after do time wait process

From: Jianguo Wu <[email protected]>

Using consume_skb() instead of kfree_skb_reason() after do normally time wait process to be drop monitor friendly.

---
 net/ipv4/tcp_ipv4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/tcp_ipv4.c +3 -1
index f9cec62..957d86c 100644
@@ -2154,7 +2154,9 @@ int tcp_v4_rcv(struct sk_buff *skb)
 		goto discard_it;
 	case TCP_TW_SUCCESS:;
 	}
-	goto discard_it;
+
+	consume_skb(skb);
+	return 0;
 }
 
 static struct timewait_sock_ops tcp_timewait_sock_ops = {
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 9 lines · Jianguo Wu

From: Jianguo Wu <[email protected]>

Using consume_skb() instead of kfree_skb_reason() after do normally time wait process to be drop monitor friendly.

---

1) net-next is closed.

2) This seems pretty much random to me, we definitely reach this point with packets that are dropped.

These are classified as drops.

You know, TCP can handle reordered packets, spurious retransmits, and stuff like that, we do not want to hide this,
otherwise we would have used consume_skb() for all packets.

After all, TCP handles all incoming packets 'normally'.

If you really care, I suggest you change (when net-next reopens in two weeks) the @reason to more precisely describe what is happening.