Skip to content

Commit 848bf15

Browse files
subravdavem330
authored andcommitted
tcp: Update MIB counters for drops
This patch updates LINUX_MIB_LISTENDROPS in tcp_v4_conn_request() and tcp_v4_err(). tcp_v4_conn_request() in particular can drop SYNs for various reasons which are not currently tracked. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9665d5d commit 848bf15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/tcp_ipv4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
496496
* errors returned from accept().
497497
*/
498498
inet_csk_reqsk_queue_drop(sk, req, prev);
499+
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
499500
goto out;
500501

501502
case TCP_SYN_SENT:
@@ -1502,7 +1503,6 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
15021503
*/
15031504
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
15041505
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
1505-
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
15061506
goto drop;
15071507
}
15081508

@@ -1669,6 +1669,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
16691669
drop_and_free:
16701670
reqsk_free(req);
16711671
drop:
1672+
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
16721673
return 0;
16731674
}
16741675
EXPORT_SYMBOL(tcp_v4_conn_request);

0 commit comments

Comments
 (0)