Skip to content

Commit

Permalink
tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()
Browse files Browse the repository at this point in the history
We drop a connection request if the accept backlog is full and there are
sufficient packets in the syn queue to warrant starting drops. Increment the
appropriate counters so this isn't silent, for accurate stats and help in
debugging.

This patch assumes LINUX_MIB_LISTENDROPS is a superset of/includes the
counter LINUX_MIB_LISTENOVERFLOWS.

Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
Acked-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nivedita Singhvi authored and David S. Miller committed Jan 29, 2013
1 parent 5e98a36 commit 2aeef18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,8 +1500,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* clogging syn queue with openreqs with exponentially increasing
* timeout.
*/
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
goto drop;
}

req = inet_reqsk_alloc(&tcp_request_sock_ops);
if (!req)
Expand Down

0 comments on commit 2aeef18

Please sign in to comment.