diff options
author | ume <ume@FreeBSD.org> | 2003-01-22 13:13:13 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-01-22 13:13:13 +0000 |
commit | 7040970198bcc972fa661a70d284669437f28cc0 (patch) | |
tree | 421b481dd91bf60b8165f5cfe634e3e456172088 /sys | |
parent | 58c84d11b03cad8da26cbc3fed01e735ec7f1647 (diff) | |
download | FreeBSD-src-7040970198bcc972fa661a70d284669437f28cc0.zip FreeBSD-src-7040970198bcc972fa661a70d284669437f28cc0.tar.gz |
getpeername() returns with no error but didn't fill struct sockaddr
correctly against PF_LOCAL. It seems that the test always fails then
sockaddr was not filled. So, I added else clause for workaround.
I doubt if it is right fix. However, it is better than nothing. I
found that NetBSD has same potential problem. But, fortunately,
NetBSD has equivalent else clause.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 2907cf2..869bc11 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -220,6 +220,8 @@ uipc_peeraddr(struct socket *so, struct sockaddr **nam) if (unp->unp_conn && unp->unp_conn->unp_addr) *nam = dup_sockaddr((struct sockaddr *)unp->unp_conn->unp_addr, 1); + else + *nam = dup_sockaddr((struct sockaddr *)&sun_noname, 1); return 0; } |