Source-Changes-HG archive

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

[src/trunk]: src/sys Revert a change that altered the semantics of AF_LOCAL s...



details:   https://anonhg.NetBSD.org/src/rev/d91c4f5f124c
branches:  trunk
changeset: 555809:d91c4f5f124c
user:      perry <perry%NetBSD.org@localhost>
date:      Sat Nov 29 06:08:29 2003 +0000

description:
Revert a change that altered the semantics of AF_LOCAL sockets. Sadly
this made us API incompatible with other Unixes.

diffstat:

 sys/kern/uipc_syscalls.c         |   6 +++---
 sys/kern/uipc_usrreq.c           |  24 ++++++------------------
 sys/miscfs/fifofs/fifo_vnops.c   |   7 +++----
 sys/miscfs/portal/portal_vnops.c |   7 +++----
 sys/sys/un.h                     |   4 ++--
 5 files changed, 17 insertions(+), 31 deletions(-)

diffs (190 lines):

diff -r 0a8e6084ee27 -r d91c4f5f124c sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c  Sat Nov 29 05:47:51 2003 +0000
+++ b/sys/kern/uipc_syscalls.c  Sat Nov 29 06:08:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls.c,v 1.84 2003/11/13 03:09:30 chs Exp $   */
+/*     $NetBSD: uipc_syscalls.c,v 1.85 2003/11/29 06:09:47 perry Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.84 2003/11/13 03:09:30 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.85 2003/11/29 06:09:47 perry Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_pipe.h"
@@ -924,7 +924,7 @@
        wf->f_ops = &socketops;
        wf->f_data = (caddr_t)wso;
        retval[1] = fd;
-       if ((error = unp_connect2(wso, rso, PRU_CONNECT2)) != 0)
+       if ((error = unp_connect2(wso, rso)) != 0)
                goto free4;
        FILE_SET_MATURE(rf);
        FILE_SET_MATURE(wf);
diff -r 0a8e6084ee27 -r d91c4f5f124c sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Sat Nov 29 05:47:51 2003 +0000
+++ b/sys/kern/uipc_usrreq.c    Sat Nov 29 06:08:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_usrreq.c,v 1.70 2003/10/15 11:29:01 hannken Exp $ */
+/*     $NetBSD: uipc_usrreq.c,v 1.71 2003/11/29 06:08:29 perry Exp $   */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.70 2003/10/15 11:29:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.71 2003/11/29 06:08:29 perry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -247,7 +247,7 @@
                break;
 
        case PRU_CONNECT2:
-               error = unp_connect2(so, (struct socket *)nam, PRU_CONNECT2);
+               error = unp_connect2(so, (struct socket *)nam);
                break;
 
        case PRU_DISCONNECT:
@@ -256,14 +256,6 @@
 
        case PRU_ACCEPT:
                unp_setpeeraddr(unp, nam);
-               /*
-                * Mark the initiating STREAM socket as connected *ONLY*
-                * after it's been accepted.  This prevents a client from
-                * overrunning a server and receiving ECONNREFUSED.
-                */
-               if (unp->unp_conn != NULL &&
-                   (unp->unp_conn->unp_socket->so_state & SS_ISCONNECTING))
-                       soisconnected(unp->unp_conn->unp_socket);
                break;
 
        case PRU_SHUTDOWN:
@@ -725,7 +717,7 @@
                unp3->unp_flags = unp2->unp_flags;
                so2 = so3;
        }
-       error = unp_connect2(so, so2, PRU_CONNECT);
+       error = unp_connect2(so, so2);
  bad:
        vput(vp);
  bad2:
@@ -734,10 +726,9 @@
 }
 
 int
-unp_connect2(so, so2, req)
+unp_connect2(so, so2)
        struct socket *so;
        struct socket *so2;
-       int req;
 {
        struct unpcb *unp = sotounpcb(so);
        struct unpcb *unp2;
@@ -756,10 +747,7 @@
 
        case SOCK_STREAM:
                unp2->unp_conn = unp;
-               if (req == PRU_CONNECT)
-                       soisconnecting(so);
-               else
-                       soisconnected(so);
+               soisconnected(so);
                soisconnected(so2);
                break;
 
diff -r 0a8e6084ee27 -r d91c4f5f124c sys/miscfs/fifofs/fifo_vnops.c
--- a/sys/miscfs/fifofs/fifo_vnops.c    Sat Nov 29 05:47:51 2003 +0000
+++ b/sys/miscfs/fifofs/fifo_vnops.c    Sat Nov 29 06:08:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fifo_vnops.c,v 1.43 2003/09/03 21:30:14 matt Exp $     */
+/*     $NetBSD: fifo_vnops.c,v 1.44 2003/11/29 06:15:00 perry Exp $    */
 
 /*
  * Copyright (c) 1990, 1993, 1995
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.43 2003/09/03 21:30:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.44 2003/11/29 06:15:00 perry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,7 +41,6 @@
 #include <sys/namei.h>
 #include <sys/vnode.h>
 #include <sys/socket.h>
-#include <sys/protosw.h>
 #include <sys/socketvar.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
@@ -175,7 +174,7 @@
                        return (error);
                }
                fip->fi_writesock = wso;
-               if ((error = unp_connect2(wso, rso, PRU_CONNECT2)) != 0) {
+               if ((error = unp_connect2(wso, rso)) != 0) {
                        (void)soclose(wso);
                        (void)soclose(rso);
                        free(fip, M_VNODE);
diff -r 0a8e6084ee27 -r d91c4f5f124c sys/miscfs/portal/portal_vnops.c
--- a/sys/miscfs/portal/portal_vnops.c  Sat Nov 29 05:47:51 2003 +0000
+++ b/sys/miscfs/portal/portal_vnops.c  Sat Nov 29 06:08:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: portal_vnops.c,v 1.50 2003/09/13 08:32:17 jdolecek Exp $       */
+/*     $NetBSD: portal_vnops.c,v 1.51 2003/11/29 06:15:00 perry Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.50 2003/09/13 08:32:17 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.51 2003/11/29 06:15:00 perry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,7 +56,6 @@
 #include <sys/namei.h>
 #include <sys/mbuf.h>
 #include <sys/socket.h>
-#include <sys/protosw.h>
 #include <sys/socketvar.h>
 #include <sys/un.h>
 #include <sys/unpcb.h>
@@ -293,7 +292,7 @@
        so2 = so3;
 
 
-       return (unp_connect2(so, so2, PRU_CONNECT2));
+       return (unp_connect2(so, so2));
 }
 
 int
diff -r 0a8e6084ee27 -r d91c4f5f124c sys/sys/un.h
--- a/sys/sys/un.h      Sat Nov 29 05:47:51 2003 +0000
+++ b/sys/sys/un.h      Sat Nov 29 06:08:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: un.h,v 1.31 2003/09/03 21:30:13 matt Exp $     */
+/*     $NetBSD: un.h,v 1.32 2003/11/29 06:14:03 perry Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -65,7 +65,7 @@
 int    unp_attach __P((struct socket *));
 int    unp_bind __P((struct unpcb *, struct mbuf *, struct proc *));
 int    unp_connect __P((struct socket *, struct mbuf *, struct proc *));
-int    unp_connect2 __P((struct socket *, struct socket *, int));
+int    unp_connect2 __P((struct socket *, struct socket *));
 void   unp_detach __P((struct unpcb *));
 void   unp_discard __P((struct file *));
 void   unp_disconnect __P((struct unpcb *));



Home | Main Index | Thread Index | Old Index