NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/49247: getsockname(2) requires sockaddr structure to cleared
The following reply was made to PR kern/49247; it has been noted by GNATS.
From: Takahiro Kambe <taca%back-street.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/49247: getsockname(2) requires sockaddr structure to
cleared
Date: Fri, 03 Oct 2014 10:58:46 +0900 (JST)
In message <20140930.183412.842932544742766590.taca%back-street.net@localhost>
on Tue, 30 Sep 2014 18:34:12 +0900 (JST),
Takahiro Kambe <taca%back-street.net@localhost> wrote:
> In message <20140930092000.E75B5A65C2%mollari.NetBSD.org@localhost>
> on Tue, 30 Sep 2014 09:20:00 +0000 (UTC),
> Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
>> Please try the attached patch.
>>
>> Joerg
> Thanks. Sure, it is fixed.
Joerg's fix solve the problem but I wonder why it was no problem on
NetBSD 6.1_STABLE.
After checking the result of the test program and I'm sure below
change is correct and make the behavior as the same as 6.1_STABLE.
(The change is in makeun().)
Index: sys/kern/uipc_usrreq.c
===================================================================
RCS file: /cvsroot/src/sys/kern/uipc_usrreq.c,v
retrieving revision 1.171
diff -u -r1.171 uipc_usrreq.c
--- sys/kern/uipc_usrreq.c 5 Sep 2014 09:20:59 -0000 1.171
+++ sys/kern/uipc_usrreq.c 3 Oct 2014 01:54:11 -0000
@@ -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;
}
--
Takahiro Kambe <taca%back-street.net@localhost>
Home |
Main Index |
Thread Index |
Old Index