. Correctly initialise msghdr (in particular, prevent garbage in msg_control,
authorGreg Lewis <glewis@eyesbeyond.com>
Wed Feb 03 23:46:39 2010 -0800 (3 years ago)
changeset 2211f974aefae43d
parent 22103ba2add1e969
child 2216107a25f9da0c
. Correctly initialise msghdr (in particular, prevent garbage in msg_control,
msg_controllen) before calling recvmsg/sendmsg as per Linux.

Problem report by: Joe Lin <jlin@maxiscale.com>
src/solaris/native/sun/nio/ch/DatagramDispatcher.c
--- a/src/solaris/native/sun/nio/ch/DatagramDispatcher.c Sat Jan 30 21:55:16 2010 -0800
+++ b/src/solaris/native/sun/nio/ch/DatagramDispatcher.c Wed Feb 03 23:46:39 2010 -0800
@@ -73,7 +73,7 @@ Java_sun_nio_ch_DatagramDispatcher_readv
m.msg_accrightslen = 0;
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
m.msg_control = NULL;
m.msg_controllen = 0;
#endif
@@ -121,7 +121,7 @@ Java_sun_nio_ch_DatagramDispatcher_write
m.msg_accrightslen = 0;
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
m.msg_control = NULL;
m.msg_controllen = 0;
#endif