aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2009-04-19 05:43:48 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-20 05:25:26 -0400
commita0f82f64e26929776c58a5c93c2ecb38e3d82815 (patch)
tree8c39812fc6fc8133cc28944e38b44c941d8fa3ce /include/net
parent7eebb0b28f755e297d355a205bb04945b256db6b (diff)
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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 1b94b9bfe2dc..b55b4891029e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -265,6 +265,19 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num)
265 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]); 265 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
266} 266}
267 267
268/* syncookies: remember time of last synqueue overflow */
269static inline void tcp_synq_overflow(struct sock *sk)
270{
271 tcp_sk(sk)->rx_opt.ts_recent_stamp = jiffies;
272}
273
274/* syncookies: no recent synqueue overflow on this listening socket? */
275static inline int tcp_synq_no_recent_overflow(const struct sock *sk)
276{
277 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
278 return time_after(jiffies, last_overflow + TCP_TIMEOUT_INIT);
279}
280
268extern struct proto tcp_prot; 281extern struct proto tcp_prot;
269 282
270#define TCP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.tcp_statistics, field) 283#define TCP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.tcp_statistics, field)