Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Make behavior of getsockname(2) (and maybe getpeern...



details:   https://anonhg.NetBSD.org/src/rev/339d1ca5281e
branches:  trunk
changeset: 332772:339d1ca5281e
user:      taca <taca%NetBSD.org@localhost>
date:      Wed Oct 08 16:13:02 2014 +0000

description:
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.

diffstat:

 sys/kern/uipc_usrreq.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 04040f577bf0 -r 339d1ca5281e sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Wed Oct 08 14:43:48 2014 +0000
+++ b/sys/kern/uipc_usrreq.c    Wed Oct 08 16:13:02 2014 +0000
@@ -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 @@
        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;
 }
 



Home | Main Index | Thread Index | Old Index