mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
tcp: Change possible SYN flooding messages
"Possible SYN flooding on port xxxx " messages can fill logs on servers. Change logic to log the message only once per listener, and add two new SNMP counters to track : TCPReqQFullDoCookies : number of times a SYNCOOKIE was replied to client TCPReqQFullDrop : number of times a SYN request was dropped because syncookies were not enabled. Based on a prior patch from Tom Herbert, and suggestions from David. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
27e95a8c67
commit
946cedccbd
6 changed files with 40 additions and 50 deletions
|
|
@ -231,6 +231,8 @@ enum
|
|||
LINUX_MIB_TCPDEFERACCEPTDROP,
|
||||
LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
|
||||
LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
|
||||
LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
|
||||
LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
|
||||
__LINUX_MIB_MAX
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ extern int sysctl_max_syn_backlog;
|
|||
*/
|
||||
struct listen_sock {
|
||||
u8 max_qlen_log;
|
||||
/* 3 bytes hole, try to use */
|
||||
u8 synflood_warned;
|
||||
/* 2 bytes hole, try to use */
|
||||
int qlen;
|
||||
int qlen_young;
|
||||
int clock_hand;
|
||||
|
|
|
|||
|
|
@ -460,6 +460,9 @@ extern int tcp_write_wakeup(struct sock *);
|
|||
extern void tcp_send_fin(struct sock *sk);
|
||||
extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
|
||||
extern int tcp_send_synack(struct sock *);
|
||||
extern int tcp_syn_flood_action(struct sock *sk,
|
||||
const struct sk_buff *skb,
|
||||
const char *proto);
|
||||
extern void tcp_push_one(struct sock *, unsigned int mss_now);
|
||||
extern void tcp_send_ack(struct sock *sk);
|
||||
extern void tcp_send_delayed_ack(struct sock *sk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue