diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-09 19:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-10 23:33:49 -0400 |
commit | ab92bb2f679d66c7e12a6b1c0cdd76fe308f6546 (patch) | |
tree | 39ba3d67d7691f65a2d67ec782edd83271a2a654 /net/ipv4/tcp_metrics.c | |
parent | 4aabd8ef8c43677cfee3e1e36c5a79edddb41942 (diff) |
tcp: Abstract back handling peer aliveness test into helper function.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_metrics.c')
-rw-r--r-- | net/ipv4/tcp_metrics.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 2793ecf928d3..9afe703c85cc 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -1,7 +1,9 @@ | |||
1 | #include <linux/module.h> | ||
1 | #include <linux/cache.h> | 2 | #include <linux/cache.h> |
2 | #include <linux/tcp.h> | 3 | #include <linux/tcp.h> |
3 | 4 | ||
4 | #include <net/inet_connection_sock.h> | 5 | #include <net/inet_connection_sock.h> |
6 | #include <net/request_sock.h> | ||
5 | #include <net/sock.h> | 7 | #include <net/sock.h> |
6 | #include <net/dst.h> | 8 | #include <net/dst.h> |
7 | #include <net/tcp.h> | 9 | #include <net/tcp.h> |
@@ -190,3 +192,11 @@ reset: | |||
190 | tp->snd_cwnd = tcp_init_cwnd(tp, dst); | 192 | tp->snd_cwnd = tcp_init_cwnd(tp, dst); |
191 | tp->snd_cwnd_stamp = tcp_time_stamp; | 193 | tp->snd_cwnd_stamp = tcp_time_stamp; |
192 | } | 194 | } |
195 | |||
196 | bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst) | ||
197 | { | ||
198 | if (!dst) | ||
199 | return false; | ||
200 | return dst_metric(dst, RTAX_RTT) ? true : false; | ||
201 | } | ||
202 | EXPORT_SYMBOL_GPL(tcp_peer_is_proven); | ||