aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/tcp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3f87fd87bc9c..fb5c66b2ab81 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1033,6 +1033,14 @@ static inline int keepalive_probes(const struct tcp_sock *tp)
1033 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; 1033 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes;
1034} 1034}
1035 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
1036static inline int tcp_fin_time(const struct sock *sk) 1044static inline int tcp_fin_time(const struct sock *sk)
1037{ 1045{
1038 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; 1046 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout;