From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net 4/5] tcp: call tcp_drop() from tcp_data_queue_ofo() Date: Mon, 23 Jul 2018 09:28:20 -0700 Message-ID: <20180723162821.11556-5-edumazet@google.com> References: <20180723162821.11556-1-edumazet@google.com> Cc: netdev , Eric Dumazet , Eric Dumazet To: "David S . Miller" , Juha-Matti Tilli , Yuchung Cheng , Soheil Hassas Yeganeh Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:37533 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388112AbeGWRac (ORCPT ); Mon, 23 Jul 2018 13:30:32 -0400 Received: by mail-pg1-f195.google.com with SMTP id n7-v6so750421pgq.4 for ; Mon, 23 Jul 2018 09:28:33 -0700 (PDT) In-Reply-To: <20180723162821.11556-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: In order to be able to give better diagnostics and detect malicious traffic, we need to have better sk->sk_drops tracking. Fixes: 9f5afeae5152 ("tcp: use an RB tree for ooo receive queue") Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng --- net/ipv4/tcp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 78068b902e7bca6e60cbe562f1554fc33b43c872..b062a76922384f6199563af7cf30a30c5baa7601 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4510,7 +4510,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) /* All the bits are present. Drop. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE); - __kfree_skb(skb); + tcp_drop(sk, skb); skb = NULL; tcp_dsack_set(sk, seq, end_seq); goto add_sack; @@ -4529,7 +4529,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) TCP_SKB_CB(skb1)->end_seq); NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE); - __kfree_skb(skb1); + tcp_drop(sk, skb1); goto merge_right; } } else if (tcp_try_coalesce(sk, skb1, -- 2.18.0.233.g985f88cf7e-goog