net: tcp: update mib LISTENOVERFLOWS if syn flood
Subsystems (3)
PATCH 1/1 net: tcp: update mib LISTENOVERFLOWS if syn flood
From: yuan linyu <[email protected]>
it's better to update mib LISTENOVERFLOWS even if packet is flood
Signed-off-by yuan linyu <[email protected]>
--- net/ipv4/tcp_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/ipv4/tcp_input.c +6 -2
@@ -6220,6 +6220,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,struct sock *fastopen_sk =NULL ;struct request_sock *req;bool want_cookie = false; +bool want_drop = false;struct dst_entry *dst;struct flowi fl;
@@ -6231,14 +6232,17 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, inet_csk_reqsk_queue_is_full(sk)) && !isn) { want_cookie =tcp_syn_flood_action (sk, skb, rsk_ops->slab_name);if (!want_cookie) - goto drop; + want_drop = true; }if (sk_acceptq_is_full (sk)) {NET_INC_STATS (sock_net (sk),LINUX_MIB_LISTENOVERFLOWS ); - goto drop; + want_drop = true; } +if (want_drop) + goto drop; + req =inet_reqsk_alloc (rsk_ops, sk, !want_cookie);if (!req) goto drop;
Signature · 1 line
2.14.1
David Miller
maintainerFrom: yuan linyu <[email protected]>
Date: Thu, 29 Mar 2018 19:20:09 +0800
Quoted 5 lines
From: yuan linyu <[email protected]>
it's better to update mib LISTENOVERFLOWS even if packet is flood
Signed-off-by yuan linyu <[email protected]>
When we drop because of synflood we had no intention of trying to add to the accept queue. Therefore bumping the listen overflow counter makes no sense.
I'm not applying this, sorry.