Eliminate XXX comments regarding allocation failures when retrieving

the peer address by using M_WAITOK in ipx_setpeeraddr() to prevent
allocation failure.  The socket reference used to reach these calls
will prevent the ipxpcb from being released prematurely.
This commit is contained in:
Robert Watson 2005-01-02 15:25:59 +00:00
parent 360fb9f83a
commit 944731d517
2 changed files with 5 additions and 5 deletions

View File

@ -301,13 +301,13 @@ ipx_setpeeraddr(ipxp, nam)
struct sockaddr **nam;
{
struct sockaddr_ipx *sipx, ssipx;
sipx = &ssipx;
bzero((caddr_t)sipx, sizeof(*sipx));
bzero(sipx, sizeof(*sipx));
sipx->sipx_len = sizeof(*sipx);
sipx->sipx_family = AF_IPX;
sipx->sipx_addr = ipxp->ipxp_faddr;
*nam = sodupsockaddr((struct sockaddr *)sipx, M_NOWAIT);
*nam = sodupsockaddr((struct sockaddr *)sipx, M_WAITOK);
}
struct ipxpcb *

View File

@ -531,7 +531,7 @@ ipx_peeraddr(so, nam)
{
struct ipxpcb *ipxp = sotoipxpcb(so);
ipx_setpeeraddr(ipxp, nam); /* XXX what if alloc fails? */
ipx_setpeeraddr(ipxp, nam);
return (0);
}
@ -599,7 +599,7 @@ ipx_sockaddr(so, nam)
{
struct ipxpcb *ipxp = sotoipxpcb(so);
ipx_setsockaddr(ipxp, nam); /* XXX what if alloc fails? */
ipx_setsockaddr(ipxp, nam);
return (0);
}