diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 2fc0d369ad58..4bd84928127e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.216 2017/08/15 09:21:48 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.216 2017/08/15 09:21:48 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -464,17 +464,14 @@ tcp_ctloutput(int op, struct socket *so, struct sockopt *sopt) #ifdef TCP_SIGNATURE case TCP_MD5SIG: optval = (tp->t_flags & TF_SIGNATURE) ? 1 : 0; - error = sockopt_set(sopt, &optval, sizeof(optval)); - break; + goto setval; #endif case TCP_NODELAY: optval = tp->t_flags & TF_NODELAY; - error = sockopt_set(sopt, &optval, sizeof(optval)); - break; + goto setval; case TCP_MAXSEG: optval = tp->t_peermss; - error = sockopt_set(sopt, &optval, sizeof(optval)); - break; + goto setval; case TCP_INFO: tcp_fill_info(tp, &ti); error = sockopt_set(sopt, &ti, sizeof ti); @@ -483,6 +480,19 @@ tcp_ctloutput(int op, struct socket *so, struct sockopt *sopt) case TCP_CONGCTL: break; #endif + case TCP_KEEPIDLE: + optval = tp->t_keepidle; + goto setval; + case TCP_KEEPINTVL: + optval = tp->t_keepintvl; + goto setval; + case TCP_KEEPCNT: + optval = tp->t_keepcnt; + goto setval; + case TCP_KEEPINIT: + optval = tp->t_keepcnt; +setval: error = sockopt_set(sopt, &optval, sizeof(optval)); + break; default: error = ENOPROTOOPT; break;