Not sure if we were taking the size of the right thing previously.

Zero out the sockaddr_in before having accept() write to it.
This un-confuses bcheck on Solaris, at least.
This commit is contained in:
Emil Mikulic 2006-12-14 10:08:34 +00:00
parent 0819e7c3c6
commit 4cddcf96a5

View File

@ -1174,7 +1174,8 @@ static void accept_connection(void)
/* allocate and initialise struct connection */
conn = new_connection();
sin_size = (socklen_t)sizeof(struct sockaddr);
sin_size = sizeof(addrin);
memset(&addrin, 0, sin_size);
conn->socket = accept(sockin, (struct sockaddr *)&addrin,
&sin_size);
if (conn->socket == -1) err(1, "accept()");