Author: tuexen
Date: Mon Sep 28 18:32:28 2009
New Revision: 197582
URL: http://svn.freebsd.org/changeset/base/197582

Log:
  MFC r197341.
  Fix errnos.
  
  Approved by: re (bz), rrs (mentor)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/sctp_output.c

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c  Mon Sep 28 18:07:16 2009        
(r197581)
+++ stable/8/sys/netinet/sctp_output.c  Mon Sep 28 18:32:28 2009        
(r197582)
@@ -12384,8 +12384,8 @@ sctp_lower_sosend(struct socket *so,
 
        t_inp = inp = (struct sctp_inpcb *)so->so_pcb;
        if (inp == NULL) {
-               SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, 
EFAULT);
-               error = EFAULT;
+               SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, 
EINVAL);
+               error = EINVAL;
                if (i_pak) {
                        SCTP_RELEASE_PKT(i_pak);
                }
@@ -12432,8 +12432,8 @@ sctp_lower_sosend(struct socket *so,
        if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
            (inp->sctp_socket->so_qlimit)) {
                /* The listener can NOT send */
-               SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, 
EFAULT);
-               error = EFAULT;
+               SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, 
ENOTCONN);
+               error = ENOTCONN;
                goto out_unlocked;
        }
        if ((use_rcvinfo) && srcv) {
@@ -12566,8 +12566,8 @@ sctp_lower_sosend(struct socket *so,
                if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) ||
                    (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) {
                        /* Should I really unlock ? */
-                       SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, 
SCTP_FROM_SCTP_OUTPUT, EFAULT);
-                       error = EFAULT;
+                       SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, 
SCTP_FROM_SCTP_OUTPUT, EINVAL);
+                       error = EINVAL;
                        goto out_unlocked;
 
                }
@@ -12596,6 +12596,12 @@ sctp_lower_sosend(struct socket *so,
                }
        }
        if (stcb == NULL) {
+               if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+                   (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
+                       SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, ENOTCONN);
+                       error = ENOTCONN;
+                       goto out_unlocked;
+               }
                if (addr == NULL) {
                        SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, ENOENT);
                        error = ENOENT;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to