NetBSD-Bugs archive

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

Re: kern/55777: more rump fixes



The following reply was made to PR kern/55777; it has been noted by GNATS.

From: Ruslan Nikolaev <rnikola%vt.edu@localhost>
To: Christos Zoulas <christos%zoulas.com@localhost>, gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/55777: more rump fixes
Date: Fri, 6 Nov 2020 08:03:33 -0500

 The previous message got garbled, so I am resending it
 
 
 diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
 index edd7d7a28df0..8a6b8bc1cb31 100644
 --- a/sys/kern/uipc_domain.c
 +++ b/sys/kern/uipc_domain.c
 @@ -692,7 +692,6 @@ sysctl_net_setup(void)
                 SYSCTL_DESCR("SOCK_DGRAM protocol control block list"),
                 sysctl_unpcblist, 0, NULL, 0,
                 CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
 -    unp_sysctl_create(&domain_sysctllog);
  }
 
  void
 diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
 index 6c1ca5a1cb3d..3d8d4118c12d 100644
 --- a/sys/kern/uipc_usrreq.c
 +++ b/sys/kern/uipc_usrreq.c
 @@ -111,6 +111,7 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.199
 2020/08/26 22:54:30 christos E
  #include <sys/socket.h>
  #include <sys/socketvar.h>
  #include <sys/unpcb.h>
 +#include <sys/sysctl.h>
  #include <sys/un.h>
  #include <sys/namei.h>
  #include <sys/vnode.h>
 @@ -197,6 +198,9 @@ static lwp_t *unp_thread_lwp;
  static SLIST_HEAD(,file) unp_thread_discard;
  static int unp_defer;
 
 +static struct sysctllog *usrreq_sysctllog;
 +static void unp_sysctl_create(void);
 +
  /* Compat interface */
 
  struct mbuf * stub_compat_70_unp_addsockcred(lwp_t *, struct mbuf *);
 @@ -219,6 +223,8 @@ uipc_init(void)
  {
      int error;
 
 +    unp_sysctl_create();
 +
      uipc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
      cv_init(&unp_thread_cv, "unpgc");
 
 @@ -1988,40 +1994,42 @@ unp_discard_later(file_t *fp)
      mutex_exit(&filelist_lock);
  }
 
 -void
 -unp_sysctl_create(struct sysctllog **clog)
 +static void
 +unp_sysctl_create(void)
  {
 -    sysctl_createv(clog, 0, NULL, NULL,
 +
 +    KASSERT(usrreq_sysctllog == NULL);
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                 CTLTYPE_LONG, "sendspace",
                 SYSCTL_DESCR("Default stream send space"),
                 NULL, 0, &unpst_sendspace, 0,
                 CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL);
 -    sysctl_createv(clog, 0, NULL, NULL,
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                 CTLTYPE_LONG, "recvspace",
                 SYSCTL_DESCR("Default stream recv space"),
                 NULL, 0, &unpst_recvspace, 0,
                 CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL);
 -    sysctl_createv(clog, 0, NULL, NULL,
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                 CTLTYPE_LONG, "sendspace",
                 SYSCTL_DESCR("Default datagram send space"),
                 NULL, 0, &unpdg_sendspace, 0,
                 CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
 -    sysctl_createv(clog, 0, NULL, NULL,
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                 CTLTYPE_LONG, "recvspace",
                 SYSCTL_DESCR("Default datagram recv space"),
                 NULL, 0, &unpdg_recvspace, 0,
                 CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
 -    sysctl_createv(clog, 0, NULL, NULL,
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READONLY,
                 CTLTYPE_INT, "inflight",
                 SYSCTL_DESCR("File descriptors in flight"),
                 NULL, 0, &unp_rights, 0,
                 CTL_NET, PF_LOCAL, CTL_CREATE, CTL_EOL);
 -    sysctl_createv(clog, 0, NULL, NULL,
 +    sysctl_createv(&usrreq_sysctllog, 0, NULL, NULL,
                 CTLFLAG_PERMANENT|CTLFLAG_READONLY,
                 CTLTYPE_INT, "deferred",
                 SYSCTL_DESCR("File descriptors deferred for close"),
 diff --git a/sys/rump/librump/rumpnet/net_stub.c
 b/sys/rump/librump/rumpnet/net_stub.c
 index e43cdec4ab3f..9810adf9aa13 100644
 --- a/sys/rump/librump/rumpnet/net_stub.c
 +++ b/sys/rump/librump/rumpnet/net_stub.c
 @@ -34,8 +34,6 @@ __KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.40
 2020/09/27 00:34:44 roy Exp $");
  #include <sys/socketvar.h>
  #include <sys/pslist.h>
  #include <sys/psref.h>
 -#include <sys/sysctl.h>
 -#include <sys/un.h>
 
  #include <net/if.h>
  #include <net/route.h>
 @@ -88,12 +86,6 @@ int ipsec_used;
  percpu_t *ipsecstat_percpu;
  u_int ipsec_spdgen;
 
 -/* sysctl */
 -void
 -unp_sysctl_create(struct sysctllog **clog)
 -{
 -}
 -
  __weak_alias(ah4_ctlinput,rumpnet_stub);
  __weak_alias(ah6_ctlinput,rumpnet_stub);
  __weak_alias(esp4_ctlinput,rumpnet_stub);
 diff --git a/sys/sys/un.h b/sys/sys/un.h
 index 2533ac7f2169..b5dde2de339d 100644
 --- a/sys/sys/un.h
 +++ b/sys/sys/un.h
 @@ -90,7 +90,6 @@ int    unp_connect(struct socket *, struct sockaddr
 *, struct lwp *);
  int    unp_connect2(struct socket *, struct socket *);
  void     unp_dispose(struct mbuf *);
  int     unp_externalize(struct mbuf *, struct lwp *, int);
 -void    unp_sysctl_create(struct sysctllog **);
 
  #else /* !_KERNEL */
 



Home | Main Index | Thread Index | Old Index