Change uipc_sockaddr so that a sockaddr_un without a path is returned
nam for an unbound socket instead of leaving nam untouched in that case. This way, the getsockname() output can be used to determine the address family of such sockets (AF_LOCAL). Reviewed by: iedowse Approved by: rwatson
This commit is contained in:
parent
c7e1887023
commit
83f3198b2b
@ -420,6 +420,8 @@ uipc_sockaddr(struct socket *so, struct sockaddr **nam)
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
if (unp->unp_addr)
|
if (unp->unp_addr)
|
||||||
*nam = dup_sockaddr((struct sockaddr *)unp->unp_addr, 1);
|
*nam = dup_sockaddr((struct sockaddr *)unp->unp_addr, 1);
|
||||||
|
else
|
||||||
|
*nam = dup_sockaddr((struct sockaddr *)&sun_noname, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user