[BACK]Return to uipc_socket.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

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

Diff for /src/sys/kern/uipc_socket.c between version 1.215.4.4 and 1.216

version 1.215.4.4, 2014/05/18 17:46:08 version 1.216, 2013/08/02 20:00:33
Line 62 
Line 62 
  *      @(#)uipc_socket.c       8.6 (Berkeley) 5/2/95   *      @(#)uipc_socket.c       8.6 (Berkeley) 5/2/95
  */   */
   
 /*  
  * Socket operation routines.  
  *  
  * These routines are called by the routines in sys_socket.c or from a  
  * system process, and implement the semantics of socket operations by  
  * switching out to the protocol specific routines.  
  */  
   
 #include <sys/cdefs.h>  #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD$");  __KERNEL_RCSID(0, "$NetBSD$");
   
Line 111  __KERNEL_RCSID(0, "$NetBSD$");
Line 103  __KERNEL_RCSID(0, "$NetBSD$");
 #include <uvm/uvm_loan.h>  #include <uvm/uvm_loan.h>
 #include <uvm/uvm_page.h>  #include <uvm/uvm_page.h>
   
   MALLOC_DEFINE(M_SOOPTS, "soopts", "socket options");
 MALLOC_DEFINE(M_SONAME, "soname", "socket name");  MALLOC_DEFINE(M_SONAME, "soname", "socket name");
   
 extern const struct fileops socketops;  extern const struct fileops socketops;
Line 423  socket_listener_cb(kauth_cred_t cred, ka
Line 416  socket_listener_cb(kauth_cred_t cred, ka
                 /* Normal users can only drop their own connections. */                  /* Normal users can only drop their own connections. */
                 struct socket *so = (struct socket *)arg1;                  struct socket *so = (struct socket *)arg1;
   
                 if (so->so_cred && proc_uidmatch(cred, so->so_cred) == 0)                  if (proc_uidmatch(cred, so->so_cred) == 0)
                         result = KAUTH_RESULT_ALLOW;                          result = KAUTH_RESULT_ALLOW;
   
                 break;                  break;
Line 486  soinit1(void)
Line 479  soinit1(void)
 }  }
   
 /*  /*
  * socreate: create a new socket of the specified type and the protocol.   * Socket operation routines.
  *   * These routines are called by the routines in
  * => Caller may specify another socket for lock sharing (must not be held).   * sys_socket.c or from a system process, and
  * => Returns the new socket without lock held.   * implement the semantics of socket operations by
    * switching out to the protocol specific routines.
  */   */
   /*ARGSUSED*/
 int  int
 socreate(int dom, struct socket **aso, int type, int proto, struct lwp *l,  socreate(int dom, struct socket **aso, int type, int proto, struct lwp *l,
          struct socket *lockso)           struct socket *lockso)
Line 520  socreate(int dom, struct socket **aso, i
Line 515  socreate(int dom, struct socket **aso, i
                         return EPROTOTYPE;                          return EPROTOTYPE;
                 return EPROTONOSUPPORT;                  return EPROTONOSUPPORT;
         }          }
         if (prp->pr_usrreqs == NULL)          if (prp->pr_usrreq == NULL)
                 return EPROTONOSUPPORT;                  return EPROTONOSUPPORT;
         if (prp->pr_type != type)          if (prp->pr_type != type)
                 return EPROTOTYPE;                  return EPROTOTYPE;
Line 528  socreate(int dom, struct socket **aso, i
Line 523  socreate(int dom, struct socket **aso, i
         so = soget(true);          so = soget(true);
         so->so_type = type;          so->so_type = type;
         so->so_proto = prp;          so->so_proto = prp;
         so->so_refcnt = 1;  
   
         so->so_send = sosend;          so->so_send = sosend;
         so->so_receive = soreceive;          so->so_receive = soreceive;
 #ifdef MBUFTRACE  #ifdef MBUFTRACE
Line 540  socreate(int dom, struct socket **aso, i
Line 533  socreate(int dom, struct socket **aso, i
         uid = kauth_cred_geteuid(l->l_cred);          uid = kauth_cred_geteuid(l->l_cred);
         so->so_uidinfo = uid_find(uid);          so->so_uidinfo = uid_find(uid);
         so->so_cpid = l->l_proc->p_pid;          so->so_cpid = l->l_proc->p_pid;
           if (lockso != NULL) {
         /*                  /* Caller wants us to share a lock. */
          * Lock assigned and taken during pr_attach, unless we share  
          * the lock with another socket, e.g. socketpair(2) case.  
          */  
         if (lockso) {  
                 lock = lockso->so_lock;                  lock = lockso->so_lock;
                 so->so_lock = lock;                  so->so_lock = lock;
                 mutex_obj_hold(lock);                  mutex_obj_hold(lock);
                   /* XXX Why is this not solock, to match sounlock? */
                   mutex_enter(lock);
           } else {
                   /* Lock assigned and taken during PRU_ATTACH. */
         }          }
           error = (*prp->pr_usrreq)(so, PRU_ATTACH, NULL,
         error = (*prp->pr_usrreqs->pr_attach)(so, proto);              (struct mbuf *)(long)proto, NULL, l);
         if (error) {          KASSERT(solocked(so));
                 solock(so);          if (error != 0) {
                 KASSERT(so->so_pcb == NULL);  
                 so->so_state |= SS_NOFDREF;                  so->so_state |= SS_NOFDREF;
                 sofree(so);                  sofree(so);
                 return error;                  return error;
         }          }
         so->so_cred = kauth_cred_dup(l->l_cred);          so->so_cred = kauth_cred_dup(l->l_cred);
           sounlock(so);
         *aso = so;          *aso = so;
         return 0;          return 0;
 }  }
   
 /*  /* On success, write file descriptor to fdout and return zero.  On
  * fsocreate: create a socket and a file descriptor associated with it.   * failure, return non-zero; *fdout will be undefined.
  *  
  * => On success, write file descriptor to fdout and return zero.  
  * => On failure, return non-zero; *fdout will be undefined.  
  */   */
 int  int
 fsocreate(int domain, struct socket **sop, int type, int proto, int *fdout)  fsocreate(int domain, struct socket **sop, int type, int protocol,
       struct lwp *l, int *fdout)
 {  {
         lwp_t *l = curlwp;          struct socket   *so;
         int error, fd, flags;          struct file     *fp;
         struct socket *so;          int             fd, error;
         struct file *fp;          int             flags = type & SOCK_FLAGS_MASK;
   
         if ((error = fd_allocfile(&fp, &fd)) != 0) {          type &= ~SOCK_FLAGS_MASK;
           if ((error = fd_allocfile(&fp, &fd)) != 0)
                 return error;                  return error;
         }  
         flags = type & SOCK_FLAGS_MASK;  
         fd_set_exclose(l, fd, (flags & SOCK_CLOEXEC) != 0);          fd_set_exclose(l, fd, (flags & SOCK_CLOEXEC) != 0);
         fp->f_flag = FREAD|FWRITE|((flags & SOCK_NONBLOCK) ? FNONBLOCK : 0)|          fp->f_flag = FREAD|FWRITE|((flags & SOCK_NONBLOCK) ? FNONBLOCK : 0)|
             ((flags & SOCK_NOSIGPIPE) ? FNOSIGPIPE : 0);              ((flags & SOCK_NOSIGPIPE) ? FNOSIGPIPE : 0);
         fp->f_type = DTYPE_SOCKET;          fp->f_type = DTYPE_SOCKET;
         fp->f_ops = &socketops;          fp->f_ops = &socketops;
           error = socreate(domain, &so, type, protocol, l, NULL);
         type &= ~SOCK_FLAGS_MASK;          if (error != 0) {
         error = socreate(domain, &so, type, proto, l, NULL);  
         if (error) {  
                 fd_abort(curproc, fp, fd);                  fd_abort(curproc, fp, fd);
                 return error;          } else {
         }                  if (sop != NULL)
         if (flags & SOCK_NONBLOCK) {                          *sop = so;
                 so->so_state |= SS_NBIO;                  fp->f_data = so;
         }                  fd_affix(curproc, fp, fd);
         fp->f_data = so;                  *fdout = fd;
         fd_affix(curproc, fp, fd);                  if (flags & SOCK_NONBLOCK)
                           so->so_state |= SS_NBIO;
         if (sop != NULL) {  
                 *sop = so;  
         }          }
         *fdout = fd;  
         return error;          return error;
 }  }
   
 void  
 soref(struct socket *so)  
 {  
         atomic_inc_uint(&so->so_refcnt);  
 }  
   
 void  
 sounref(struct socket *so)  
 {  
         if (atomic_dec_uint_nv(&so->so_refcnt) > 0) {  
                 return;  
         }  
         soput(so);  
 }  
   
 int  int
 sofamily(const struct socket *so)  sofamily(const struct socket *so)
 {  {
Line 639  sofamily(const struct socket *so)
Line 608  sofamily(const struct socket *so)
 int  int
 sobind(struct socket *so, struct mbuf *nam, struct lwp *l)  sobind(struct socket *so, struct mbuf *nam, struct lwp *l)
 {  {
         int error;          int     error;
   
         solock(so);          solock(so);
         error = (*so->so_proto->pr_usrreqs->pr_generic)(so,          error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, NULL, nam, NULL, l);
             PRU_BIND, NULL, nam, NULL, l);  
         sounlock(so);          sounlock(so);
         return error;          return error;
 }  }
Line 651  sobind(struct socket *so, struct mbuf *n
Line 619  sobind(struct socket *so, struct mbuf *n
 int  int
 solisten(struct socket *so, int backlog, struct lwp *l)  solisten(struct socket *so, int backlog, struct lwp *l)
 {  {
         int error;          int     error;
   
         solock(so);          solock(so);
         if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING |          if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING |
             SS_ISDISCONNECTING)) != 0) {              SS_ISDISCONNECTING)) != 0) {
                 sounlock(so);                  sounlock(so);
                 return EINVAL;                  return (EINVAL);
         }          }
         error = (*so->so_proto->pr_usrreqs->pr_generic)(so,          error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL,
             PRU_LISTEN, NULL, NULL, NULL, l);              NULL, NULL, l);
         if (error != 0) {          if (error != 0) {
                 sounlock(so);                  sounlock(so);
                 return error;                  return error;
Line 677  solisten(struct socket *so, int backlog,
Line 645  solisten(struct socket *so, int backlog,
 void  void
 sofree(struct socket *so)  sofree(struct socket *so)
 {  {
           u_int refs;
   
         KASSERT(solocked(so));          KASSERT(solocked(so));
   
Line 706  sofree(struct socket *so)
Line 675  sofree(struct socket *so)
         KASSERT(!cv_has_waiters(&so->so_rcv.sb_cv));          KASSERT(!cv_has_waiters(&so->so_rcv.sb_cv));
         KASSERT(!cv_has_waiters(&so->so_snd.sb_cv));          KASSERT(!cv_has_waiters(&so->so_snd.sb_cv));
         sorflush(so);          sorflush(so);
           refs = so->so_aborting; /* XXX */
         /* Remove acccept filter if one is present. */          /* Remove acccept filter if one is present. */
         if (so->so_accf != NULL)          if (so->so_accf != NULL)
                 (void)accept_filt_clear(so);                  (void)accept_filt_clear(so);
         sounlock(so);          sounlock(so);
           if (refs == 0)          /* XXX */
         /* Will soput() if the last reference. */                  soput(so);
         sounref(so);  
 }  }
   
 /*  /*
  * soclose: close a socket on last file table reference removal.   * Close a socket on last file table reference removal.
  * Initiate disconnect if connected.  Free socket when disconnect complete.   * Initiate disconnect if connected.
    * Free socket when disconnect complete.
  */   */
 int  int
 soclose(struct socket *so)  soclose(struct socket *so)
 {  {
         struct socket *so2;          struct socket   *so2;
         int error = 0;          int             error;
           int             error2;
   
           error = 0;
         solock(so);          solock(so);
         if (so->so_options & SO_ACCEPTCONN) {          if (so->so_options & SO_ACCEPTCONN) {
                 for (;;) {                  for (;;) {
Line 747  soclose(struct socket *so)
Line 719  soclose(struct socket *so)
                         break;                          break;
                 }                  }
         }          }
         if (so->so_pcb == NULL)          if (so->so_pcb == 0)
                 goto discard;                  goto discard;
         if (so->so_state & SS_ISCONNECTED) {          if (so->so_state & SS_ISCONNECTED) {
                 if ((so->so_state & SS_ISDISCONNECTING) == 0) {                  if ((so->so_state & SS_ISDISCONNECTING) == 0) {
Line 768  soclose(struct socket *so)
Line 740  soclose(struct socket *so)
         }          }
  drop:   drop:
         if (so->so_pcb) {          if (so->so_pcb) {
                 (*so->so_proto->pr_usrreqs->pr_detach)(so);                  error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH,
                       NULL, NULL, NULL, NULL);
                   if (error == 0)
                           error = error2;
         }          }
  discard:   discard:
         KASSERT((so->so_state & SS_NOFDREF) == 0);          if (so->so_state & SS_NOFDREF)
                   panic("soclose: NOFDREF");
         kauth_cred_free(so->so_cred);          kauth_cred_free(so->so_cred);
         so->so_state |= SS_NOFDREF;          so->so_state |= SS_NOFDREF;
         sofree(so);          sofree(so);
         return error;          return (error);
 }  }
   
 /*  /*
Line 786  soabort(struct socket *so)
Line 762  soabort(struct socket *so)
 {  {
         u_int refs;          u_int refs;
         int error;          int error;
   
         KASSERT(solocked(so));          KASSERT(solocked(so));
         KASSERT(so->so_head == NULL);          KASSERT(so->so_head == NULL);
   
         soref(so);          so->so_aborting++;              /* XXX */
         error = (*so->so_proto->pr_usrreqs->pr_generic)(so,          error = (*so->so_proto->pr_usrreq)(so, PRU_ABORT, NULL,
             PRU_ABORT, NULL, NULL, NULL, NULL);              NULL, NULL, NULL);
         refs = so->so_refcnt;          refs = --so->so_aborting;       /* XXX */
         sounref(so);          if (error || (refs == 0)) {
   
         /* XXX: Fix PRU_ABORT to behave consistently. */  
         if (error || refs == 1) {  
                 sofree(so);                  sofree(so);
         } else {          } else {
                 sounlock(so);                  sounlock(so);
         }          }
         sounref(so);  
         return error;          return error;
 }  }
   
 int  int
 soaccept(struct socket *so, struct mbuf *nam)  soaccept(struct socket *so, struct mbuf *nam)
 {  {
         int error;          int     error;
   
         KASSERT(solocked(so));          KASSERT(solocked(so));
         KASSERT((so->so_state & SS_NOFDREF) != 0);  
   
           error = 0;
           if ((so->so_state & SS_NOFDREF) == 0)
                   panic("soaccept: !NOFDREF");
         so->so_state &= ~SS_NOFDREF;          so->so_state &= ~SS_NOFDREF;
   
         if ((so->so_state & SS_ISDISCONNECTED) == 0 ||          if ((so->so_state & SS_ISDISCONNECTED) == 0 ||
             (so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0)              (so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0)
                 error = (*so->so_proto->pr_usrreqs->pr_generic)(so,                  error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT,
                     PRU_ACCEPT, NULL, nam, NULL, NULL);                      NULL, nam, NULL, NULL);
         else          else
                 error = ECONNABORTED;                  error = ECONNABORTED;
   
         return error;          return (error);
 }  }
   
 int  int
 soconnect(struct socket *so, struct mbuf *nam, struct lwp *l)  soconnect(struct socket *so, struct mbuf *nam, struct lwp *l)
 {  {
         int error;          int             error;
   
         KASSERT(solocked(so));          KASSERT(solocked(so));
   
         if (so->so_options & SO_ACCEPTCONN)          if (so->so_options & SO_ACCEPTCONN)
                 return EOPNOTSUPP;                  return (EOPNOTSUPP);
         /*          /*
          * If protocol is connection-based, can only connect once.           * If protocol is connection-based, can only connect once.
          * Otherwise, if connected, try to disconnect first.           * Otherwise, if connected, try to disconnect first.
Line 846  soconnect(struct socket *so, struct mbuf
Line 819  soconnect(struct socket *so, struct mbuf
             (error = sodisconnect(so))))              (error = sodisconnect(so))))
                 error = EISCONN;                  error = EISCONN;
         else          else
                 error = (*so->so_proto->pr_usrreqs->pr_generic)(so,                  error = (*so->so_proto->pr_usrreq)(so, PRU_CONNECT,
                     PRU_CONNECT, NULL, nam, NULL, l);                      NULL, nam, NULL, l);
           return (error);
         return error;  
 }  }
   
 int  int
 soconnect2(struct socket *so1, struct socket *so2)  soconnect2(struct socket *so1, struct socket *so2)
 {  {
           int     error;
   
         KASSERT(solocked2(so1, so2));          KASSERT(solocked2(so1, so2));
   
         return (*so1->so_proto->pr_usrreqs->pr_generic)(so1,          error = (*so1->so_proto->pr_usrreq)(so1, PRU_CONNECT2,
             PRU_CONNECT2, NULL, (struct mbuf *)so2, NULL, NULL);              NULL, (struct mbuf *)so2, NULL, NULL);
           return (error);
 }  }
   
 int  int
Line 873  sodisconnect(struct socket *so)
Line 848  sodisconnect(struct socket *so)
         } else if (so->so_state & SS_ISDISCONNECTING) {          } else if (so->so_state & SS_ISDISCONNECTING) {
                 error = EALREADY;                  error = EALREADY;
         } else {          } else {
                 error = (*so->so_proto->pr_usrreqs->pr_generic)(so,                  error = (*so->so_proto->pr_usrreq)(so, PRU_DISCONNECT,
                     PRU_DISCONNECT, NULL, NULL, NULL, NULL);                      NULL, NULL, NULL, NULL);
         }          }
         return (error);          return (error);
 }  }
Line 952  sosend(struct socket *so, struct mbuf *a
Line 927  sosend(struct socket *so, struct mbuf *a
                 }                  }
                 if ((so->so_state & SS_ISCONNECTED) == 0) {                  if ((so->so_state & SS_ISCONNECTED) == 0) {
                         if (so->so_proto->pr_flags & PR_CONNREQUIRED) {                          if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
                                 if (resid || clen == 0) {                                  if ((so->so_state & SS_ISCONFIRMING) == 0 &&
                                       !(resid == 0 && clen != 0)) {
                                         error = ENOTCONN;                                          error = ENOTCONN;
                                         goto release;                                          goto release;
                                 }                                  }
Line 1070  sosend(struct socket *so, struct mbuf *a
Line 1046  sosend(struct socket *so, struct mbuf *a
                                 so->so_options |= SO_DONTROUTE;                                  so->so_options |= SO_DONTROUTE;
                         if (resid > 0)                          if (resid > 0)
                                 so->so_state |= SS_MORETOCOME;                                  so->so_state |= SS_MORETOCOME;
                         error = (*so->so_proto->pr_usrreqs->pr_generic)(so,                          error = (*so->so_proto->pr_usrreq)(so,
                             (flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND,                              (flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND,
                             top, addr, control, curlwp);                              top, addr, control, curlwp);
                         if (dontroute)                          if (dontroute)
Line 1184  soreceive(struct socket *so, struct mbuf
Line 1160  soreceive(struct socket *so, struct mbuf
         if (flags & MSG_OOB) {          if (flags & MSG_OOB) {
                 m = m_get(M_WAIT, MT_DATA);                  m = m_get(M_WAIT, MT_DATA);
                 solock(so);                  solock(so);
                 error = (*pr->pr_usrreqs->pr_generic)(so, PRU_RCVOOB, m,                  error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m,
                     (struct mbuf *)(long)(flags & MSG_PEEK), NULL, l);                      (struct mbuf *)(long)(flags & MSG_PEEK), NULL, l);
                 sounlock(so);                  sounlock(so);
                 if (error)                  if (error)
Line 1209  soreceive(struct socket *so, struct mbuf
Line 1185  soreceive(struct socket *so, struct mbuf
          */           */
         s = splsoftnet();          s = splsoftnet();
         solock(so);          solock(so);
           if (so->so_state & SS_ISCONFIRMING && uio->uio_resid)
                   (*pr->pr_usrreq)(so, PRU_RCVD, NULL, NULL, NULL, l);
   
  restart:   restart:
         if ((error = sblock(&so->so_rcv, SBLOCKWAIT(flags))) != 0) {          if ((error = sblock(&so->so_rcv, SBLOCKWAIT(flags))) != 0) {
                 sounlock(so);                  sounlock(so);
Line 1552  soreceive(struct socket *so, struct mbuf
Line 1531  soreceive(struct socket *so, struct mbuf
                          * get it filled again.                           * get it filled again.
                          */                           */
                         if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb)                          if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb)
                                 (*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD,                                  (*pr->pr_usrreq)(so, PRU_RCVD,
                                     NULL, (struct mbuf *)(long)flags, NULL, l);                                      NULL, (struct mbuf *)(long)flags, NULL, l);
                         SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 2");                          SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 2");
                         SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 2");                          SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 2");
Line 1594  soreceive(struct socket *so, struct mbuf
Line 1573  soreceive(struct socket *so, struct mbuf
                 SBLASTRECORDCHK(&so->so_rcv, "soreceive 4");                  SBLASTRECORDCHK(&so->so_rcv, "soreceive 4");
                 SBLASTMBUFCHK(&so->so_rcv, "soreceive 4");                  SBLASTMBUFCHK(&so->so_rcv, "soreceive 4");
                 if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)                  if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
                         (*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD, NULL,                          (*pr->pr_usrreq)(so, PRU_RCVD, NULL,
                             (struct mbuf *)(long)flags, NULL, l);                              (struct mbuf *)(long)flags, NULL, l);
         }          }
         if (orig_resid == uio->uio_resid && orig_resid &&          if (orig_resid == uio->uio_resid && orig_resid &&
Line 1629  soshutdown(struct socket *so, int how)
Line 1608  soshutdown(struct socket *so, int how)
                 error = 0;                  error = 0;
         }          }
         if (how == SHUT_WR || how == SHUT_RDWR)          if (how == SHUT_WR || how == SHUT_RDWR)
                 error = (*pr->pr_usrreqs->pr_generic)(so,                  error = (*pr->pr_usrreq)(so, PRU_SHUTDOWN, NULL,
                     PRU_SHUTDOWN, NULL, NULL, NULL, NULL);                      NULL, NULL, NULL);
   
         return error;          return error;
 }  }
Line 1689  sorflush(struct socket *so)
Line 1668  sorflush(struct socket *so)
 static int  static int
 sosetopt1(struct socket *so, const struct sockopt *sopt)  sosetopt1(struct socket *so, const struct sockopt *sopt)
 {  {
         int error = EINVAL, opt;          int error = EINVAL, optval, opt;
         int optval = 0; /* XXX: gcc */  
         struct linger l;          struct linger l;
         struct timeval tv;          struct timeval tv;
   
Line 1932  sogetopt1(struct socket *so, struct sock
Line 1910  sogetopt1(struct socket *so, struct sock
 #ifdef SO_OTIMESTAMP  #ifdef SO_OTIMESTAMP
         case SO_OTIMESTAMP:          case SO_OTIMESTAMP:
 #endif  #endif
         case SO_ACCEPTCONN:  
                 error = sockopt_setint(sopt, (so->so_options & opt) ? 1 : 0);                  error = sockopt_setint(sopt, (so->so_options & opt) ? 1 : 0);
                 break;                  break;
   
Line 2450  sysctl_kern_socket_setup(void)
Line 2427  sysctl_kern_socket_setup(void)
 {  {
   
         KASSERT(socket_sysctllog == NULL);          KASSERT(socket_sysctllog == NULL);
           sysctl_createv(&socket_sysctllog, 0, NULL, NULL,
                          CTLFLAG_PERMANENT,
                          CTLTYPE_NODE, "kern", NULL,
                          NULL, 0, NULL, 0,
                          CTL_KERN, CTL_EOL);
   
         sysctl_createv(&socket_sysctllog, 0, NULL, NULL,          sysctl_createv(&socket_sysctllog, 0, NULL, NULL,
                        CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,

Legend:
Removed from v.1.215.4.4  
changed lines
  Added in v.1.216

CVSweb <webmaster@jp.NetBSD.org>