Author: bz
Date: Sat Feb 20 22:29:28 2010
New Revision: 204147
URL: http://svn.freebsd.org/changeset/base/204147

Log:
  Set curvnet earlier so that it also covers calls to sodisconnect(), which
  before were possibly panicing the system in ULP code in the VIMAGE case.
  
  Submitted by: Igor (igor ispsystem.com)
  MFC after:    5 days

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c Sat Feb 20 22:24:24 2010        (r204146)
+++ head/sys/kern/uipc_socket.c Sat Feb 20 22:29:28 2010        (r204147)
@@ -773,6 +773,8 @@ soconnect(struct socket *so, struct sock
 
        if (so->so_options & SO_ACCEPTCONN)
                return (EOPNOTSUPP);
+
+       CURVNET_SET(so->so_vnet);
        /*
         * If protocol is connection-based, can only connect once.
         * Otherwise, if connected, try to disconnect first.  This allows
@@ -788,10 +790,9 @@ soconnect(struct socket *so, struct sock
                 * biting us.
                 */
                so->so_error = 0;
-               CURVNET_SET(so->so_vnet);
                error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td);
-               CURVNET_RESTORE();
        }
+       CURVNET_RESTORE();
 
        return (error);
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to