]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/uipc_socket.c
xnu-517.3.15.tar.gz
[apple/xnu.git] / bsd / kern / uipc_socket.c
index 21595dab896f6b543e87bdf98cabd2844c77fd1f..243cf880b04362cfa9f207c2109c62759f4c6326 100644 (file)
@@ -1424,9 +1424,14 @@ dontblock:
        if ((pr->pr_flags & PR_ADDR) && m->m_type == MT_SONAME) {
                KASSERT(m->m_type == MT_SONAME, ("receive 1a"));
                orig_resid = 0;
-               if (psa)
+               if (psa) {
                        *psa = dup_sockaddr(mtod(m, struct sockaddr *),
                                            mp0 == 0);
+                       if ((*psa == 0) && (flags & MSG_NEEDSA)) {
+                               error = EWOULDBLOCK;
+                               goto release;
+                       }
+               }
                if (flags & MSG_PEEK) {
                        m = m->m_next;
                } else {