diff options
author | glebius <glebius@FreeBSD.org> | 2013-11-08 13:04:14 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-11-08 13:04:14 +0000 |
commit | 290e21e968ad5e93272ed64ba9cfa452265507d2 (patch) | |
tree | 7cbe899b6e5835542d633ef52801fe64bb7a52cc /sys/netinet/tcp_usrreq.c | |
parent | fd1717ac3eb3fb2f4e91cdbcbf478dc6da92da07 (diff) | |
download | FreeBSD-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.c | 21 |
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; |