summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-11-08 13:04:14 +0000
committerglebius <glebius@FreeBSD.org>2013-11-08 13:04:14 +0000
commit290e21e968ad5e93272ed64ba9cfa452265507d2 (patch)
tree7cbe899b6e5835542d633ef52801fe64bb7a52cc /sys/netinet/tcp_usrreq.c
parentfd1717ac3eb3fb2f4e91cdbcbf478dc6da92da07 (diff)
downloadFreeBSD-src-290e21e968ad5e93272ed64ba9cfa452265507d2.zip
FreeBSD-src-290e21e968ad5e93272ed64ba9cfa452265507d2.tar.gz
Make TCP_KEEP* socket options readable. At least PostgreSQL wants
to read the values. Reported by: sobomax
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index da592f8..0188beb 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1585,6 +1585,27 @@ unlock_and_done:
INP_WUNLOCK(inp);
error = sooptcopyout(sopt, buf, TCP_CA_NAME_MAX);
break;
+ case TCP_KEEPIDLE:
+ case TCP_KEEPINTVL:
+ case TCP_KEEPINIT:
+ case TCP_KEEPCNT:
+ switch (sopt->sopt_name) {
+ case TCP_KEEPIDLE:
+ ui = tp->t_keepidle / hz;
+ break;
+ case TCP_KEEPINTVL:
+ ui = tp->t_keepintvl / hz;
+ break;
+ case TCP_KEEPINIT:
+ ui = tp->t_keepinit / hz;
+ break;
+ case TCP_KEEPCNT:
+ ui = tp->t_keepcnt;
+ break;
+ }
+ INP_WUNLOCK(inp);
+ error = sooptcopyout(sopt, &ui, sizeof(ui));
+ break;
default:
INP_WUNLOCK(inp);
error = ENOPROTOOPT;
OpenPOWER on IntegriCloud