diff options
author | Eric Dumazet <edumazet@google.com> | 2015-10-02 14:43:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-03 07:32:37 -0400 |
commit | 8d2675f1e464aa5cedda63849adecffd8d33fead (patch) | |
tree | e1d28155d25be1e48275152f6703b0f4cecf6911 /net/ipv4/tcp_input.c | |
parent | aac065c50aba0c534a929aeb687eb68c58e523b8 (diff) |
tcp: move synflood_warned into struct request_sock_queue
long term plan is to remove struct listen_sock when its hash
table is no longer there.
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index e58cbcd2f07e..8b0ce73c2049 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -6068,9 +6068,9 @@ static bool tcp_syn_flood_action(const struct sock *sk, | |||
6068 | const struct sk_buff *skb, | 6068 | const struct sk_buff *skb, |
6069 | const char *proto) | 6069 | const char *proto) |
6070 | { | 6070 | { |
6071 | struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; | ||
6071 | const char *msg = "Dropping request"; | 6072 | const char *msg = "Dropping request"; |
6072 | bool want_cookie = false; | 6073 | bool want_cookie = false; |
6073 | struct listen_sock *lopt; | ||
6074 | 6074 | ||
6075 | #ifdef CONFIG_SYN_COOKIES | 6075 | #ifdef CONFIG_SYN_COOKIES |
6076 | if (sysctl_tcp_syncookies) { | 6076 | if (sysctl_tcp_syncookies) { |
@@ -6081,10 +6081,9 @@ static bool tcp_syn_flood_action(const struct sock *sk, | |||
6081 | #endif | 6081 | #endif |
6082 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP); | 6082 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP); |
6083 | 6083 | ||
6084 | lopt = inet_csk(sk)->icsk_accept_queue.listen_opt; | 6084 | if (!queue->synflood_warned && |
6085 | if (!lopt->synflood_warned && | ||
6086 | sysctl_tcp_syncookies != 2 && | 6085 | sysctl_tcp_syncookies != 2 && |
6087 | xchg(&lopt->synflood_warned, 1) == 0) | 6086 | xchg(&queue->synflood_warned, 1) == 0) |
6088 | pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n", | 6087 | pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n", |
6089 | proto, ntohs(tcp_hdr(skb)->dest), msg); | 6088 | proto, ntohs(tcp_hdr(skb)->dest), msg); |
6090 | 6089 | ||