diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e073517b2cc7..5aababa20a21 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -856,35 +856,6 @@ static void tcp_v4_reqsk_destructor(struct request_sock *req) | |||
856 | kfree(inet_rsk(req)->opt); | 856 | kfree(inet_rsk(req)->opt); |
857 | } | 857 | } |
858 | 858 | ||
859 | /* | ||
860 | * Return true if a syncookie should be sent | ||
861 | */ | ||
862 | bool tcp_syn_flood_action(struct sock *sk, | ||
863 | const struct sk_buff *skb, | ||
864 | const char *proto) | ||
865 | { | ||
866 | const char *msg = "Dropping request"; | ||
867 | bool want_cookie = false; | ||
868 | struct listen_sock *lopt; | ||
869 | |||
870 | #ifdef CONFIG_SYN_COOKIES | ||
871 | if (sysctl_tcp_syncookies) { | ||
872 | msg = "Sending cookies"; | ||
873 | want_cookie = true; | ||
874 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDOCOOKIES); | ||
875 | } else | ||
876 | #endif | ||
877 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP); | ||
878 | |||
879 | lopt = inet_csk(sk)->icsk_accept_queue.listen_opt; | ||
880 | if (!lopt->synflood_warned && sysctl_tcp_syncookies != 2) { | ||
881 | lopt->synflood_warned = 1; | ||
882 | pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n", | ||
883 | proto, ntohs(tcp_hdr(skb)->dest), msg); | ||
884 | } | ||
885 | return want_cookie; | ||
886 | } | ||
887 | EXPORT_SYMBOL(tcp_syn_flood_action); | ||
888 | 859 | ||
889 | #ifdef CONFIG_TCP_MD5SIG | 860 | #ifdef CONFIG_TCP_MD5SIG |
890 | /* | 861 | /* |