From 83f3198b2b3af307d9de3b8c7b6519f98e057c0d Mon Sep 17 00:00:00 2001 From: Thomas Moestl Date: Tue, 24 Apr 2001 19:09:23 +0000 Subject: [PATCH] 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 --- sys/kern/uipc_usrreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index de295b1cdb6d..a26754ca8ac4 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -420,6 +420,8 @@ uipc_sockaddr(struct socket *so, struct sockaddr **nam) return EINVAL; if (unp->unp_addr) *nam = dup_sockaddr((struct sockaddr *)unp->unp_addr, 1); + else + *nam = dup_sockaddr((struct sockaddr *)&sun_noname, 1); return 0; }