conn.c: fix more sizeof(..dst_addr) misuse

the wrong sizeof() usage fixed in
d76910ce7b
(conn.c: fix resolver server address backlog) was a bit more
widespread, fix all others, too.
This commit is contained in:
Florian Westphal 2009-09-11 23:30:42 +02:00
parent ed72bf4ceb
commit 4daf780f01
1 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ cb_connserver(int sock, UNUSED short what)
/* connection to dst_addr[0] in progress, remove this address... */ /* connection to dst_addr[0] in progress, remove this address... */
Conf_Server[res].dst_addr[0] = Conf_Server[res].dst_addr[1]; Conf_Server[res].dst_addr[0] = Conf_Server[res].dst_addr[1];
memset(&Conf_Server[res].dst_addr[1], 0, sizeof(&Conf_Server[res].dst_addr[1])); memset(&Conf_Server[res].dst_addr[1], 0, sizeof(Conf_Server[res].dst_addr[1]));
} }
return; return;
} }
@ -192,7 +192,7 @@ cb_connserver(int sock, UNUSED short what)
res = Conf_GetServer(idx); res = Conf_GetServer(idx);
assert(res >= 0); assert(res >= 0);
if (res >= 0) /* connect succeeded, remove all additional addresses */ if (res >= 0) /* connect succeeded, remove all additional addresses */
memset(&Conf_Server[res].dst_addr, 0, sizeof(&Conf_Server[res].dst_addr)); memset(&Conf_Server[res].dst_addr, 0, sizeof(Conf_Server[res].dst_addr));
Conn_OPTION_DEL( &My_Connections[idx], CONN_ISCONNECTING ); Conn_OPTION_DEL( &My_Connections[idx], CONN_ISCONNECTING );
#ifdef SSL_SUPPORT #ifdef SSL_SUPPORT
if ( Conn_OPTION_ISSET( &My_Connections[idx], CONN_SSL_CONNECT )) { if ( Conn_OPTION_ISSET( &My_Connections[idx], CONN_SSL_CONNECT )) {