aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-01 11:52:20 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-04 22:11:20 -0400
commit9caad864151e525929d323de96cad382da49c3b2 (patch)
tree76935ef9f746ebccd30c6cb397bc920ad1cb4b98 /net/ipv4/tcp_input.c
parent532182cd610782db8c18230c2747626562032205 (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_input.c')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 0ffcd07e3409..983f04c11177 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6339,8 +6339,10 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
6339 inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT); 6339 inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
6340 af_ops->send_synack(sk, dst, &fl, req, 6340 af_ops->send_synack(sk, dst, &fl, req,
6341 &foc, !want_cookie); 6341 &foc, !want_cookie);
6342 if (want_cookie) 6342 if (want_cookie) {
6343 goto drop_and_free; 6343 reqsk_free(req);
6344 return 0;
6345 }
6344 } 6346 }
6345 reqsk_put(req); 6347 reqsk_put(req);
6346 return 0; 6348 return 0;
@@ -6350,7 +6352,7 @@ drop_and_release:
6350drop_and_free: 6352drop_and_free:
6351 reqsk_free(req); 6353 reqsk_free(req);
6352drop: 6354drop:
6353 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 6355 tcp_listendrop(sk);
6354 return 0; 6356 return 0;
6355} 6357}
6356EXPORT_SYMBOL(tcp_conn_request); 6358EXPORT_SYMBOL(tcp_conn_request);