Source-Changes-HG archive

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

[src/netbsd-8]: src/sys Pull up following revision(s) (requested by ozaki-r i...



details:   https://anonhg.NetBSD.org/src/rev/b893611902bb
branches:  netbsd-8
changeset: 320604:b893611902bb
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jul 13 15:49:55 2018 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #911):

        sys/kern/init_main.c: revision 1.498
        sys/rump/net/lib/libnet/net_component.c: revision 1.10
        sys/net/if.h: revision 1.264
        sys/net/if.c: revision 1.429

Fix net.inet6.ip6.ifq node doesn't exist

The node (and child nodes) is initialized in sysctl_net_pktq_setup, but the call
of sysctl_net_pktq_setup is skipped unexpectedly.
sysctl_net_pktq_setup is skipped if in6_present is false that indicates the
netinet6 component isn't loaded on rump kernels.  However the flag is
accidentally always false because the flag is turned on in in6_dom_init that is
called after if_sysctl_setup on both normal and rump kernels.

Fix the issue by moving if_sysctl_setup after in6_dom_init (domaininit on normal
kernels).  This fix is ad-hoc but good enough for netbsd-8.  We should refine
the initialization order of network components in the future.

Pointed out by hikaru@

diffstat:

 sys/kern/init_main.c                    |   5 +++--
 sys/net/if.c                            |  14 ++++++++++----
 sys/net/if.h                            |   3 ++-
 sys/rump/net/lib/libnet/net_component.c |   5 +++--
 4 files changed, 18 insertions(+), 9 deletions(-)

diffs (110 lines):

diff -r b67b36a7a394 -r b893611902bb sys/kern/init_main.c
--- a/sys/kern/init_main.c      Fri Jul 13 14:43:46 2018 +0000
+++ b/sys/kern/init_main.c      Fri Jul 13 15:49:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.490 2017/01/16 09:28:40 ryo Exp $      */
+/*     $NetBSD: init_main.c,v 1.490.6.1 2018/07/13 15:49:55 martin Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.490 2017/01/16 09:28:40 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.490.6.1 2018/07/13 15:49:55 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -558,6 +558,7 @@
        lltableinit();
 #endif
        domaininit(true);
+       ifinit_post();
        if_attachdomain();
        splx(s);
 
diff -r b67b36a7a394 -r b893611902bb sys/net/if.c
--- a/sys/net/if.c      Fri Jul 13 14:43:46 2018 +0000
+++ b/sys/net/if.c      Fri Jul 13 15:49:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.394.2.11 2018/06/07 17:50:54 martin Exp $     */
+/*     $NetBSD: if.c,v 1.394.2.12 2018/07/13 15:49:55 martin Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.11 2018/06/07 17:50:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.12 2018/07/13 15:49:55 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -291,8 +291,6 @@
 ifinit(void)
 {
 
-       if_sysctl_setup(NULL);
-
 #if (defined(INET) || defined(INET6))
        encapinit();
 #endif
@@ -330,6 +328,14 @@
 #endif
 }
 
+/* XXX must be after domaininit() */
+void
+ifinit_post(void)
+{
+
+       if_sysctl_setup(NULL);
+}
+
 ifnet_t *
 if_alloc(u_char type)
 {
diff -r b67b36a7a394 -r b893611902bb sys/net/if.h
--- a/sys/net/if.h      Fri Jul 13 14:43:46 2018 +0000
+++ b/sys/net/if.h      Fri Jul 13 15:49:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.239.2.6 2018/07/13 14:26:48 martin Exp $      */
+/*     $NetBSD: if.h,v 1.239.2.7 2018/07/13 15:49:55 martin Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -1088,6 +1088,7 @@
 void   if_up(struct ifnet *);
 void   ifinit(void);
 void   ifinit1(void);
+void   ifinit_post(void);
 int    ifaddrpref_ioctl(struct socket *, u_long, void *, struct ifnet *);
 extern int (*ifioctl)(struct socket *, u_long, void *, struct lwp *);
 int    ifioctl_common(struct ifnet *, u_long, void *);
diff -r b67b36a7a394 -r b893611902bb sys/rump/net/lib/libnet/net_component.c
--- a/sys/rump/net/lib/libnet/net_component.c   Fri Jul 13 14:43:46 2018 +0000
+++ b/sys/rump/net/lib/libnet/net_component.c   Fri Jul 13 15:49:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: net_component.c,v 1.9 2017/02/16 08:39:10 knakahara Exp $      */
+/*     $NetBSD: net_component.c,v 1.9.6.1 2018/07/13 15:49:55 martin Exp $     */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.9 2017/02/16 08:39:10 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.9.6.1 2018/07/13 15:49:55 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/domain.h>
@@ -65,5 +65,6 @@
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
 {
 
+       ifinit_post();
        loopinit();
 }



Home | Main Index | Thread Index | Old Index