mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
syncookies: remove last_synq_overflow from struct tcp_sock
last_synq_overflow eats 4 or 8 bytes in struct tcp_sock, even though it is only used when a listening sockets syn queue is full. We can (ab)use rx_opt.ts_recent_stamp to store the same information; it is not used otherwise as long as a socket is in listen state. Move linger2 around to avoid splitting struct mtu_probe across cacheline boundary on 32 bit arches. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7eebb0b28f
commit
a0f82f64e2
4 changed files with 18 additions and 8 deletions
|
@ -265,6 +265,19 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num)
|
|||
atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
|
||||
}
|
||||
|
||||
/* syncookies: remember time of last synqueue overflow */
|
||||
static inline void tcp_synq_overflow(struct sock *sk)
|
||||
{
|
||||
tcp_sk(sk)->rx_opt.ts_recent_stamp = jiffies;
|
||||
}
|
||||
|
||||
/* syncookies: no recent synqueue overflow on this listening socket? */
|
||||
static inline int tcp_synq_no_recent_overflow(const struct sock *sk)
|
||||
{
|
||||
unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
|
||||
return time_after(jiffies, last_overflow + TCP_TIMEOUT_INIT);
|
||||
}
|
||||
|
||||
extern struct proto tcp_prot;
|
||||
|
||||
#define TCP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.tcp_statistics, field)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue