diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 4fee0424af7e..38509f047382 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
60 | */ | 60 | */ |
61 | #define MAX_TCP_WINDOW 32767U | 61 | #define MAX_TCP_WINDOW 32767U |
62 | 62 | ||
63 | /* Offer an initial receive window of 10 mss. */ | ||
64 | #define TCP_DEFAULT_INIT_RCVWND 10 | ||
65 | |||
63 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 66 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
64 | #define TCP_MIN_MSS 88U | 67 | #define TCP_MIN_MSS 88U |
65 | 68 | ||
@@ -100,12 +103,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
100 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a | 103 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a |
101 | * connection: ~180sec is RFC minimum */ | 104 | * connection: ~180sec is RFC minimum */ |
102 | 105 | ||
103 | |||
104 | #define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned | ||
105 | * socket. 7 is ~50sec-16min. | ||
106 | */ | ||
107 | |||
108 | |||
109 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | 106 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT |
110 | * state, about 60 seconds */ | 107 | * state, about 60 seconds */ |
111 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN | 108 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN |
@@ -224,7 +221,7 @@ extern int sysctl_tcp_fack; | |||
224 | extern int sysctl_tcp_reordering; | 221 | extern int sysctl_tcp_reordering; |
225 | extern int sysctl_tcp_ecn; | 222 | extern int sysctl_tcp_ecn; |
226 | extern int sysctl_tcp_dsack; | 223 | extern int sysctl_tcp_dsack; |
227 | extern int sysctl_tcp_mem[3]; | 224 | extern long sysctl_tcp_mem[3]; |
228 | extern int sysctl_tcp_wmem[3]; | 225 | extern int sysctl_tcp_wmem[3]; |
229 | extern int sysctl_tcp_rmem[3]; | 226 | extern int sysctl_tcp_rmem[3]; |
230 | extern int sysctl_tcp_app_win; | 227 | extern int sysctl_tcp_app_win; |
@@ -247,7 +244,7 @@ extern int sysctl_tcp_cookie_size; | |||
247 | extern int sysctl_tcp_thin_linear_timeouts; | 244 | extern int sysctl_tcp_thin_linear_timeouts; |
248 | extern int sysctl_tcp_thin_dupack; | 245 | extern int sysctl_tcp_thin_dupack; |
249 | 246 | ||
250 | extern atomic_t tcp_memory_allocated; | 247 | extern atomic_long_t tcp_memory_allocated; |
251 | extern struct percpu_counter tcp_sockets_allocated; | 248 | extern struct percpu_counter tcp_sockets_allocated; |
252 | extern int tcp_memory_pressure; | 249 | extern int tcp_memory_pressure; |
253 | 250 | ||
@@ -280,7 +277,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
280 | } | 277 | } |
281 | 278 | ||
282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && | 279 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && |
283 | atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) | 280 | atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) |
284 | return true; | 281 | return true; |
285 | return false; | 282 | return false; |
286 | } | 283 | } |
@@ -312,7 +309,8 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
312 | 309 | ||
313 | extern int tcp_v4_rcv(struct sk_buff *skb); | 310 | extern int tcp_v4_rcv(struct sk_buff *skb); |
314 | 311 | ||
315 | extern int tcp_v4_remember_stamp(struct sock *sk); | 312 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); |
313 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
316 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 314 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
317 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 315 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
318 | size_t size); | 316 | size_t size); |
@@ -1043,7 +1041,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | |||
1043 | return 1; | 1041 | return 1; |
1044 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1042 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
1045 | return 1; | 1043 | return 1; |
1046 | 1044 | /* | |
1045 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | ||
1046 | * then following tcp messages have valid values. Ignore 0 value, | ||
1047 | * or else 'negative' tsval might forbid us to accept their packets. | ||
1048 | */ | ||
1049 | if (!rx_opt->ts_recent) | ||
1050 | return 1; | ||
1047 | return 0; | 1051 | return 0; |
1048 | } | 1052 | } |
1049 | 1053 | ||
@@ -1157,8 +1161,6 @@ struct tcp_md5sig_pool { | |||
1157 | union tcp_md5sum_block md5_blk; | 1161 | union tcp_md5sum_block md5_blk; |
1158 | }; | 1162 | }; |
1159 | 1163 | ||
1160 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | ||
1161 | |||
1162 | /* - functions */ | 1164 | /* - functions */ |
1163 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1165 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
1164 | struct sock *sk, struct request_sock *req, | 1166 | struct sock *sk, struct request_sock *req, |