X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..9bccf70c0258c7cac2dcb80011b2a964d884c552:/bsd/netat/ddp_usrreq.c diff --git a/bsd/netat/ddp_usrreq.c b/bsd/netat/ddp_usrreq.c index b46a541c7..7d327ab60 100644 --- a/bsd/netat/ddp_usrreq.c +++ b/bsd/netat/ddp_usrreq.c @@ -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();