Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet add some more getsockopt(2) params



details:   https://anonhg.NetBSD.org/src/rev/278257c55af6
branches:  trunk
changeset: 826105:278257c55af6
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 15 09:21:48 2017 +0000

description:
add some more getsockopt(2) params

diffstat:

 sys/netinet/tcp_usrreq.c |  26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r 87a29b87ca49 -r 278257c55af6 sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Tue Aug 15 09:16:59 2017 +0000
+++ b/sys/netinet/tcp_usrreq.c  Tue Aug 15 09:21:48 2017 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
 #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 @@
                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;



Home | Main Index | Thread Index | Old Index