diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 70e55d200610..743accec6c76 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -282,6 +282,7 @@ extern int sysctl_tcp_limit_output_bytes; | |||
282 | extern int sysctl_tcp_challenge_ack_limit; | 282 | extern int sysctl_tcp_challenge_ack_limit; |
283 | extern unsigned int sysctl_tcp_notsent_lowat; | 283 | extern unsigned int sysctl_tcp_notsent_lowat; |
284 | extern int sysctl_tcp_min_tso_segs; | 284 | extern int sysctl_tcp_min_tso_segs; |
285 | extern int sysctl_tcp_autocorking; | ||
285 | 286 | ||
286 | extern atomic_long_t tcp_memory_allocated; | 287 | extern atomic_long_t tcp_memory_allocated; |
287 | extern struct percpu_counter tcp_sockets_allocated; | 288 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -467,7 +468,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
467 | struct tcp_fastopen_cookie *foc); | 468 | struct tcp_fastopen_cookie *foc); |
468 | int tcp_disconnect(struct sock *sk, int flags); | 469 | int tcp_disconnect(struct sock *sk, int flags); |
469 | 470 | ||
470 | void tcp_connect_init(struct sock *sk); | ||
471 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); | 471 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); |
472 | int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); | 472 | int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); |
473 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); | 473 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); |
@@ -480,20 +480,21 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
480 | #ifdef CONFIG_SYN_COOKIES | 480 | #ifdef CONFIG_SYN_COOKIES |
481 | #include <linux/ktime.h> | 481 | #include <linux/ktime.h> |
482 | 482 | ||
483 | /* Syncookies use a monotonic timer which increments every 64 seconds. | 483 | /* Syncookies use a monotonic timer which increments every 60 seconds. |
484 | * This counter is used both as a hash input and partially encoded into | 484 | * This counter is used both as a hash input and partially encoded into |
485 | * the cookie value. A cookie is only validated further if the delta | 485 | * the cookie value. A cookie is only validated further if the delta |
486 | * between the current counter value and the encoded one is less than this, | 486 | * between the current counter value and the encoded one is less than this, |
487 | * i.e. a sent cookie is valid only at most for 128 seconds (or less if | 487 | * i.e. a sent cookie is valid only at most for 2*60 seconds (or less if |
488 | * the counter advances immediately after a cookie is generated). | 488 | * the counter advances immediately after a cookie is generated). |
489 | */ | 489 | */ |
490 | #define MAX_SYNCOOKIE_AGE 2 | 490 | #define MAX_SYNCOOKIE_AGE 2 |
491 | 491 | ||
492 | static inline u32 tcp_cookie_time(void) | 492 | static inline u32 tcp_cookie_time(void) |
493 | { | 493 | { |
494 | struct timespec now; | 494 | u64 val = get_jiffies_64(); |
495 | getnstimeofday(&now); | 495 | |
496 | return now.tv_sec >> 6; /* 64 seconds granularity */ | 496 | do_div(val, 60 * HZ); |
497 | return val; | ||
497 | } | 498 | } |
498 | 499 | ||
499 | u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, | 500 | u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, |
@@ -622,8 +623,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | |||
622 | return (tp->srtt >> 3) + tp->rttvar; | 623 | return (tp->srtt >> 3) + tp->rttvar; |
623 | } | 624 | } |
624 | 625 | ||
625 | void tcp_set_rto(struct sock *sk); | ||
626 | |||
627 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 626 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
628 | { | 627 | { |
629 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 628 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
@@ -977,13 +976,6 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp) | |||
977 | } | 976 | } |
978 | bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); | 977 | bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); |
979 | 978 | ||
980 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, | ||
981 | const struct sk_buff *skb) | ||
982 | { | ||
983 | if (skb->len < mss) | ||
984 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; | ||
985 | } | ||
986 | |||
987 | static inline void tcp_check_probe_timer(struct sock *sk) | 979 | static inline void tcp_check_probe_timer(struct sock *sk) |
988 | { | 980 | { |
989 | const struct tcp_sock *tp = tcp_sk(sk); | 981 | const struct tcp_sock *tp = tcp_sk(sk); |
@@ -1312,7 +1304,8 @@ struct tcp_fastopen_request { | |||
1312 | /* Fast Open cookie. Size 0 means a cookie request */ | 1304 | /* Fast Open cookie. Size 0 means a cookie request */ |
1313 | struct tcp_fastopen_cookie cookie; | 1305 | struct tcp_fastopen_cookie cookie; |
1314 | struct msghdr *data; /* data in MSG_FASTOPEN */ | 1306 | struct msghdr *data; /* data in MSG_FASTOPEN */ |
1315 | u16 copied; /* queued in tcp_connect() */ | 1307 | size_t size; |
1308 | int copied; /* queued in tcp_connect() */ | ||
1316 | }; | 1309 | }; |
1317 | void tcp_free_fastopen_req(struct tcp_sock *tp); | 1310 | void tcp_free_fastopen_req(struct tcp_sock *tp); |
1318 | 1311 | ||