Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/netinet Pull up following revision(s) (requested by k...



details:   https://anonhg.NetBSD.org/src/rev/26df5dcfbdb3
branches:  netbsd-6
changeset: 776511:26df5dcfbdb3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Dec 14 19:29:29 2013 +0000

description:
Pull up following revision(s) (requested by kefren in ticket #992):
        sys/netinet/tcp_usrreq.c: revision 1.170
Update TCP CB with new values on rfc1323 and mssdflt sysctl updates
=46rom yasuoka-cj7TXg5MjN14Eiagz67IpQ%public.gmane.org@localhost in kern/44254

diffstat:

 sys/netinet/tcp_usrreq.c |  43 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 38 insertions(+), 5 deletions(-)

diffs (87 lines):

diff -r 0e7010b117e3 -r 26df5dcfbdb3 sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Sat Dec 14 19:26:39 2013 +0000
+++ b/sys/netinet/tcp_usrreq.c  Sat Dec 14 19:29:29 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_usrreq.c,v 1.162.2.2 2013/10/20 13:29:37 bouyer Exp $      */
+/*     $NetBSD: tcp_usrreq.c,v 1.162.2.3 2013/12/14 19:29:29 bouyer Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -95,7 +95,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.162.2.2 2013/10/20 13:29:37 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.162.2.3 2013/12/14 19:29:29 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1048,10 +1048,43 @@
                return (EINVAL);
        tcp_mssdflt = mssdflt;
 
+       mutex_enter(softnet_lock);
+       tcp_tcpcb_template();
+       mutex_exit(softnet_lock);
+
        return (0);
 }
 
 /*
+ * sysctl helper for TCP CB template update
+ */
+static int
+sysctl_update_tcpcb_template(SYSCTLFN_ARGS)
+{
+       int t, error;
+       struct sysctlnode node;
+
+       /* follow procedures in sysctl(9) manpage */
+       t = *(int *)rnode->sysctl_data;
+       node = *rnode;
+       node.sysctl_data = &t;
+       error = sysctl_lookup(SYSCTLFN_CALL(&node));
+       if (error || newp == NULL)
+               return error;
+
+       if (t < 0)
+               return EINVAL;
+
+       *(int *)rnode->sysctl_data = t;
+
+       mutex_enter(softnet_lock);
+       tcp_tcpcb_template();
+       mutex_exit(softnet_lock);
+
+       return 0;
+}
+
+/*
  * sysctl helper routine for setting port related values under
  * net.inet.ip and net.inet6.ip6.  does basic range checking and does
  * additional checks for each type.  this code has placed in
@@ -1676,7 +1709,7 @@
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                       CTLTYPE_INT, "rfc1323",
                       SYSCTL_DESCR("Enable RFC1323 TCP extensions"),
-                      NULL, 0, &tcp_do_rfc1323, 0,
+                      sysctl_update_tcpcb_template, 0, &tcp_do_rfc1323, 0,
                       CTL_NET, pf, IPPROTO_TCP, TCPCTL_RFC1323, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
@@ -1776,13 +1809,13 @@
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                       CTLTYPE_INT, "win_scale",
                       SYSCTL_DESCR("Use RFC1323 window scale options"),
-                      NULL, 0, &tcp_do_win_scale, 0,
+                      sysctl_update_tcpcb_template, 0, &tcp_do_win_scale, 0,
                       CTL_NET, pf, IPPROTO_TCP, TCPCTL_WSCALE, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                       CTLTYPE_INT, "timestamps",
                       SYSCTL_DESCR("Use RFC1323 time stamp options"),
-                      NULL, 0, &tcp_do_timestamps, 0,
+                      sysctl_update_tcpcb_template, 0, &tcp_do_timestamps, 0,
                       CTL_NET, pf, IPPROTO_TCP, TCPCTL_TSTAMP, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,



Home | Main Index | Thread Index | Old Index