aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index aa04b9a5093b..a1449144848a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -294,6 +294,7 @@ extern struct proto tcp_prot;
294#define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) 294#define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field)
295#define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) 295#define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field)
296#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) 296#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
297#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
297 298
298extern void tcp_v4_err(struct sk_buff *skb, u32); 299extern void tcp_v4_err(struct sk_buff *skb, u32);
299 300
@@ -423,7 +424,7 @@ extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
423 * TCP v4 functions exported for the inet6 API 424 * TCP v4 functions exported for the inet6 API
424 */ 425 */
425 426
426extern void tcp_v4_send_check(struct sock *sk, int len, 427extern void tcp_v4_send_check(struct sock *sk,
427 struct sk_buff *skb); 428 struct sk_buff *skb);
428 429
429extern int tcp_v4_conn_request(struct sock *sk, 430extern int tcp_v4_conn_request(struct sock *sk,
@@ -939,7 +940,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
939 940
940 tp->ucopy.memory = 0; 941 tp->ucopy.memory = 0;
941 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) { 942 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
942 wake_up_interruptible_sync_poll(sk->sk_sleep, 943 wake_up_interruptible_sync_poll(sk_sleep(sk),
943 POLLIN | POLLRDNORM | POLLRDBAND); 944 POLLIN | POLLRDNORM | POLLRDBAND);
944 if (!inet_csk_ack_scheduled(sk)) 945 if (!inet_csk_ack_scheduled(sk))
945 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, 946 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
@@ -1032,6 +1033,14 @@ static inline int keepalive_probes(const struct tcp_sock *tp)
1032 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; 1033 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes;
1033} 1034}
1034 1035
1036static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp)
1037{
1038 const struct inet_connection_sock *icsk = &tp->inet_conn;
1039
1040 return min_t(u32, tcp_time_stamp - icsk->icsk_ack.lrcvtime,
1041 tcp_time_stamp - tp->rcv_tstamp);
1042}
1043
1035static inline int tcp_fin_time(const struct sock *sk) 1044static inline int tcp_fin_time(const struct sock *sk)
1036{ 1045{
1037 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; 1046 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout;