]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/ddp_usrreq.c
xnu-344.tar.gz
[apple/xnu.git] / bsd / netat / ddp_usrreq.c
index b46a541c70af1d1d5a58124ce75533f8c96039b2..7d327ab6008cb05d72c13e12c7df27f99e39f9a8 100644 (file)
@@ -184,7 +184,14 @@ int        ddp_pru_send(struct socket *so, int flags, struct mbuf *m,
 
        if (pcb == NULL)
                return (EINVAL);
-
+               
+       /*
+        * Set type to MSG_DATA.  Otherwise looped back packet is not
+        * recognized by atp_input() and possibly other protocols.
+        */
+        
+       MCHTYPE(m, MSG_DATA);
+       
        if (!(pcb->ddp_flags & DDPFLG_HDRINCL)) {
                /* prepend a DDP header */
                M_PREPEND(m, DDP_X_HDR_SIZE, M_WAIT);
@@ -259,6 +266,8 @@ int   ddp_pru_sockaddr(struct socket *so,
        struct sockaddr_at *sat;
 
        MALLOC(sat, struct sockaddr_at *, sizeof *sat, M_SONAME, M_WAITOK);
+       if (sat == NULL)
+               return(ENOMEM);
        bzero((caddr_t)sat, sizeof(*sat));
 
        s = splnet();
@@ -287,6 +296,8 @@ int  ddp_pru_peeraddr(struct socket *so,
        struct sockaddr_at *sat;
 
        MALLOC(sat, struct sockaddr_at *, sizeof *sat, M_SONAME, M_WAITOK);
+       if (sat == NULL)
+               return (ENOMEM);
        bzero((caddr_t)sat, sizeof(*sat));
 
        s = splnet();