Commit 2aeef18d authored by Nivedita Singhvi's avatar Nivedita Singhvi Committed by David S. Miller

tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()

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: default avatarNivedita Singhvi <niv@us.ibm.com>
Acked-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5e98a36e
...@@ -1500,8 +1500,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1500,8 +1500,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* clogging syn queue with openreqs with exponentially increasing * clogging syn queue with openreqs with exponentially increasing
* timeout. * 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; goto drop;
}
req = inet_reqsk_alloc(&tcp_request_sock_ops); req = inet_reqsk_alloc(&tcp_request_sock_ops);
if (!req) if (!req)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment