Skip to content

Commit 5f1e942

Browse files
subravdavem330
authored andcommitted
tcp: ipv6: Update MIB counters for drops
This patch updates LINUX_MIB_LISTENDROPS and LINUX_MIB_LISTENOVERFLOWS in tcp_v6_conn_request() and tcp_v6_err(). tcp_v6_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 848bf15 commit 5f1e942

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/ipv6/tcp_ipv6.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
423423
}
424424

425425
inet_csk_reqsk_queue_drop(sk, req, prev);
426+
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
426427
goto out;
427428

428429
case TCP_SYN_SENT:
@@ -958,8 +959,10 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
958959
goto drop;
959960
}
960961

961-
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
962+
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
963+
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
962964
goto drop;
965+
}
963966

964967
req = inet6_reqsk_alloc(&tcp6_request_sock_ops);
965968
if (req == NULL)
@@ -1108,6 +1111,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
11081111
drop_and_free:
11091112
reqsk_free(req);
11101113
drop:
1114+
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
11111115
return 0; /* don't send reset */
11121116
}
11131117

0 commit comments

Comments
 (0)