Pull up following revision(s) (requested by taca in ticket #132):

sys/kern/uipc_usrreq.c: revision 1.172
Make behavior of getsockname(2) (and maybe getpeername(2)) as the same as
NetBSD 6.1_STABLE and other operating system (OS X 10.9.5).
* sa_len of sockaddr_un strucrure is always set to sizeof(sun_path).
* pathname stored in sun_path is alwasys '\0' terminated (except length
  of sun_path is sizeof(sun_path)?).
Should be fix PR kern/49247, runtime problem of lmtp service of dovecot2 on
NetBSD current and NetBSD 7.0_BETA.
This commit is contained in:
snj 2014-10-11 16:16:44 +00:00
parent a5f36bbb32
commit 58113c5c71
1 changed files with 2 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_usrreq.c,v 1.169 2014/08/09 05:33:00 rtr Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.169.2.1 2014/10/11 16:16:44 snj Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169 2014/08/09 05:33:00 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169.2.1 2014/10/11 16:16:44 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -927,8 +927,6 @@ makeun(struct mbuf *nam, size_t *addrlen) {
sun = malloc(*addrlen, M_SONAME, M_WAITOK);
m_copydata(nam, 0, nam->m_len, (void *)sun);
*(((char *)sun) + nam->m_len) = '\0';
sun->sun_len = strlen(sun->sun_path) +
offsetof(struct sockaddr_un, sun_path);
return sun;
}