Module Name:    src
Committed By:   pooka
Date:           Tue Apr 21 10:39:41 UTC 2015

Modified Files:
        src/sys/net: if.c

Log Message:
Attach PF_INET6 pktq sysctls only when inet6 is present.

More modular initialization would be nicer, but at least this patch
prevents "sysctl -a" from crashing when INET6 is defined by inet6 has
not been attached.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/net/if.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.310 src/sys/net/if.c:1.311
--- src/sys/net/if.c:1.310	Mon Apr 20 10:19:54 2015
+++ src/sys/net/if.c	Tue Apr 21 10:39:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.310 2015/04/20 10:19:54 roy Exp $	*/
+/*	$NetBSD: if.c,v 1.311 2015/04/21 10:39:41 pooka 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.310 2015/04/20 10:19:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.311 2015/04/21 10:39:41 pooka Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -239,7 +239,8 @@ ifinit(void)
 	sysctl_net_pktq_setup(NULL, PF_INET);
 #endif
 #ifdef INET6
-	sysctl_net_pktq_setup(NULL, PF_INET6);
+	if (in6_present)
+		sysctl_net_pktq_setup(NULL, PF_INET6);
 #endif
 
 	if_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK,

Reply via email to