aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/tcp.h4
-rw-r--r--include/net/tcp.h13
2 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 9d5078bd23a3..8afac76cd748 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -377,7 +377,7 @@ struct tcp_sock {
377 unsigned int keepalive_time; /* time before keep alive takes place */ 377 unsigned int keepalive_time; /* time before keep alive takes place */
378 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 378 unsigned int keepalive_intvl; /* time interval between keep alive probes */
379 379
380 unsigned long last_synq_overflow; 380 int linger2;
381 381
382/* Receiver side RTT estimation */ 382/* Receiver side RTT estimation */
383 struct { 383 struct {
@@ -406,8 +406,6 @@ struct tcp_sock {
406/* TCP MD5 Signagure Option information */ 406/* TCP MD5 Signagure Option information */
407 struct tcp_md5sig_info *md5sig_info; 407 struct tcp_md5sig_info *md5sig_info;
408#endif 408#endif
409
410 int linger2;
411}; 409};
412 410
413static inline struct tcp_sock *tcp_sk(const struct sock *sk) 411static inline struct tcp_sock *tcp_sk(const struct sock *sk)
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)