zero init stack-based struct sockaddrin instances; rm refs to sin_zero padding in non-ports files (#28)

This commit is contained in:
shuegr-personal
2020-01-15 21:48:55 -08:00
committed by Steve Karg
parent aaec7ef817
commit 7f5045ff3f
3 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -138,7 +138,7 @@ void *dl_ip_thread(void *pArgs)
bool dl_ip_init(ROUTER_PORT *port, IP_DATA *ip_data)
{
struct sockaddr_in sin;
struct sockaddr_in sin = { 0 };
int socket_opt = 0;
int status = 0; /* for error checking */
@@ -185,8 +185,6 @@ bool dl_ip_init(ROUTER_PORT *port, IP_DATA *ip_data)
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port = ip_data->port;
memset(&sin.sin_zero, '\0', sizeof(sin.sin_zero));
status = bind(ip_data->socket, (const struct sockaddr *)&sin,
sizeof(struct sockaddr));
if (status < 0) {