summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_metrics.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-09 16:19:30 -0700
committerDavid S. Miller <davem@davemloft.net>2012-07-10 20:33:49 -0700
commitab92bb2f679d66c7e12a6b1c0cdd76fe308f6546 (patch)
tree39ba3d67d7691f65a2d67ec782edd83271a2a654 /net/ipv4/tcp_metrics.c
parent4aabd8ef8c43677cfee3e1e36c5a79edddb41942 (diff)
downloadtalos-obmc-linux-ab92bb2f679d66c7e12a6b1c0cdd76fe308f6546.tar.gz
talos-obmc-linux-ab92bb2f679d66c7e12a6b1c0cdd76fe308f6546.zip
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.c10
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 @@
+#include <linux/module.h>
#include <linux/cache.h>
#include <linux/tcp.h>
#include <net/inet_connection_sock.h>
+#include <net/request_sock.h>
#include <net/sock.h>
#include <net/dst.h>
#include <net/tcp.h>
@@ -190,3 +192,11 @@ reset:
tp->snd_cwnd = tcp_init_cwnd(tp, dst);
tp->snd_cwnd_stamp = tcp_time_stamp;
}
+
+bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst)
+{
+ if (!dst)
+ return false;
+ return dst_metric(dst, RTAX_RTT) ? true : false;
+}
+EXPORT_SYMBOL_GPL(tcp_peer_is_proven);
OpenPOWER on IntegriCloud