diff options
author | Eric Dumazet <edumazet@google.com> | 2016-04-01 11:52:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-04 22:11:20 -0400 |
commit | 9caad864151e525929d323de96cad382da49c3b2 (patch) | |
tree | 76935ef9f746ebccd30c6cb397bc920ad1cb4b98 /net/ipv4/tcp_ipv4.c | |
parent | 532182cd610782db8c18230c2747626562032205 (diff) |
tcp: increment sk_drops for listeners
Goal: packets dropped by a listener are accounted for.
This adds tcp_listendrop() helper, and clears sk_drops in sk_clone_lock()
so that children do not inherit their parent drop count.
Note that we no longer increment LINUX_MIB_LISTENDROPS counter when
sending a SYNCOOKIE, since the SYN packet generated a SYNACK.
We already have a separate LINUX_MIB_SYNCOOKIESSENT
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 059a98f5e7e1..f3ce0afe70aa 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -329,7 +329,7 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort) | |||
329 | * errors returned from accept(). | 329 | * errors returned from accept(). |
330 | */ | 330 | */ |
331 | inet_csk_reqsk_queue_drop(req->rsk_listener, req); | 331 | inet_csk_reqsk_queue_drop(req->rsk_listener, req); |
332 | NET_INC_STATS_BH(net, LINUX_MIB_LISTENDROPS); | 332 | tcp_listendrop(req->rsk_listener); |
333 | } | 333 | } |
334 | reqsk_put(req); | 334 | reqsk_put(req); |
335 | } | 335 | } |
@@ -1246,7 +1246,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1246 | &tcp_request_sock_ipv4_ops, sk, skb); | 1246 | &tcp_request_sock_ipv4_ops, sk, skb); |
1247 | 1247 | ||
1248 | drop: | 1248 | drop: |
1249 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | 1249 | tcp_listendrop(sk); |
1250 | return 0; | 1250 | return 0; |
1251 | } | 1251 | } |
1252 | EXPORT_SYMBOL(tcp_v4_conn_request); | 1252 | EXPORT_SYMBOL(tcp_v4_conn_request); |
@@ -1348,7 +1348,7 @@ exit_overflow: | |||
1348 | exit_nonewsk: | 1348 | exit_nonewsk: |
1349 | dst_release(dst); | 1349 | dst_release(dst); |
1350 | exit: | 1350 | exit: |
1351 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | 1351 | tcp_listendrop(sk); |
1352 | return NULL; | 1352 | return NULL; |
1353 | put_and_exit: | 1353 | put_and_exit: |
1354 | inet_csk_prepare_forced_close(newsk); | 1354 | inet_csk_prepare_forced_close(newsk); |