Enable some sysctl knobs on rump kernels for ifmcstat

This commit is contained in:
ozaki-r 2017-01-10 05:42:34 +00:00
parent 9ac3cb6dea
commit a94a205118
5 changed files with 33 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.369 2016/12/26 23:21:49 christos Exp $ */
/* $NetBSD: if.c,v 1.370 2017/01/10 05:42:34 ozaki-r 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.369 2016/12/26 23:21:49 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.370 2017/01/10 05:42:34 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -238,6 +238,8 @@ static void if_deferred_start_destroy(struct ifnet *);
static void sysctl_net_pktq_setup(struct sysctllog **, int);
#endif
static void if_sysctl_setup(struct sysctllog **);
/*
* Pointer to stub or real compat_cvtcmd() depending on presence of
* the compat module
@ -286,13 +288,8 @@ if_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie,
void
ifinit(void)
{
#if defined(INET)
sysctl_net_pktq_setup(NULL, PF_INET);
#endif
#ifdef INET6
if (in6_present)
sysctl_net_pktq_setup(NULL, PF_INET6);
#endif
if_sysctl_setup(NULL);
#if (defined(INET) || defined(INET6)) && !defined(IPSEC)
encapinit();
@ -3555,7 +3552,8 @@ out0:
return error;
}
SYSCTL_SETUP(sysctl_net_sdl_setup, "sysctl net.sdl subtree setup")
static void
if_sysctl_setup(struct sysctllog **clog)
{
const struct sysctlnode *rnode = NULL;
@ -3565,4 +3563,12 @@ SYSCTL_SETUP(sysctl_net_sdl_setup, "sysctl net.sdl subtree setup")
SYSCTL_DESCR("Get active link-layer address"),
if_sdl_sysctl, 0, NULL, 0,
CTL_NET, CTL_CREATE, CTL_EOL);
#if defined(INET)
sysctl_net_pktq_setup(NULL, PF_INET);
#endif
#ifdef INET6
if (in6_present)
sysctl_net_pktq_setup(NULL, PF_INET6);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ethersubr.c,v 1.233 2017/01/10 05:40:59 ozaki-r Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.234 2017/01/10 05:42:34 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.233 2017/01/10 05:40:59 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.234 2017/01/10 05:42:34 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1620,7 +1620,8 @@ out:
return error;
}
SYSCTL_SETUP(sysctl_net_ether_setup, "sysctl net.ether subtree setup")
static void
ether_sysctl_setup(struct sysctllog **clog)
{
const struct sysctlnode *rnode = NULL;
@ -1642,5 +1643,7 @@ SYSCTL_SETUP(sysctl_net_ether_setup, "sysctl net.ether subtree setup")
void
etherinit(void)
{
mutex_init(&bigpktpps_lock, MUTEX_DEFAULT, IPL_NET);
ether_sysctl_setup(NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.230 2017/01/04 19:37:14 christos Exp $ */
/* $NetBSD: in6.c,v 1.231 2017/01/10 05:42:34 ozaki-r Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.230 2017/01/04 19:37:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.231 2017/01/10 05:42:34 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -162,6 +162,8 @@ in6_init(void)
PSLIST_INIT(&in6_ifaddr_list);
mutex_init(&in6_ifaddr_lock, MUTEX_DEFAULT, IPL_NONE);
in6_sysctl_multicast_setup(NULL);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_var.h,v 1.88 2017/01/04 19:37:14 christos Exp $ */
/* $NetBSD: in6_var.h,v 1.89 2017/01/10 05:42:34 ozaki-r Exp $ */
/* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */
/*
@ -820,6 +820,8 @@ struct in6pcb;
#define LLTABLE6(ifp) (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable)
void in6_sysctl_multicast_setup(struct sysctllog **);
#endif /* _KERNEL */
#endif /* !_NETINET6_IN6_VAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mld6.c,v 1.75 2016/11/18 06:50:04 knakahara Exp $ */
/* $NetBSD: mld6.c,v 1.76 2017/01/10 05:42:34 ozaki-r Exp $ */
/* $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $ */
/*
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.75 2016/11/18 06:50:04 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.76 2017/01/10 05:42:34 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1099,7 +1099,8 @@ done:
return error;
}
SYSCTL_SETUP(sysctl_in6_mklude_setup, "sysctl net.inet6.multicast_kludge subtree setup")
void
in6_sysctl_multicast_setup(struct sysctllog **clog)
{
sysctl_createv(clog, 0, NULL, NULL,