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:
parent
360fb9f83a
commit
944731d517
@ -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 *
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user