Module Name: src
Committed By: taca
Date: Wed Oct 8 16:13:02 UTC 2014
Modified Files:
src/sys/kern: uipc_usrreq.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/kern/uipc_usrreq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.171 src/sys/kern/uipc_usrreq.c:1.172
--- src/sys/kern/uipc_usrreq.c:1.171 Fri Sep 5 09:20:59 2014
+++ src/sys/kern/uipc_usrreq.c Wed Oct 8 16:13:02 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_usrreq.c,v 1.171 2014/09/05 09:20:59 matt Exp $ */
+/* $NetBSD: uipc_usrreq.c,v 1.172 2014/10/08 16:13:02 taca 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.171 2014/09/05 09:20:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.172 2014/10/08 16:13:02 taca 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;
}