diff --git a/Changelog b/Changelog index dda1b51..506819f 100644 --- a/Changelog +++ b/Changelog @@ -1,7 +1,7 @@ [Changes 1.2c01] * Fix known problem with IPv6 on FreeBSD and enable IPv6 on all supporting - platforms. Thanks to brabes and snadge. (caf) + platforms. Thanks to brabes, snadge and packet. (caf) * Improve connect() error handling. (caf) diff --git a/source/network.c b/source/network.c index a048e53..2bb20cd 100644 --- a/source/network.c +++ b/source/network.c @@ -520,7 +520,7 @@ int BX_connect_by_number(char *hostn, unsigned short *portnum, int service, int } #endif - memset(&server, 0, sizeof(struct sockaddr_in)); + memset(&server, 0, sizeof server); #ifndef WINNT #ifdef IPV6 @@ -554,7 +554,7 @@ int BX_connect_by_number(char *hostn, unsigned short *portnum, int service, int if (LocalHostName && !getaddrinfo(LocalHostName, NULL, &hints, &res) && res) { - if (bind(fd, (struct sockaddr *) res->ai_addr, sizeof(struct sockaddr_foobar))) + if (bind(fd, (struct sockaddr *) res->ai_addr, res->ai_addrlen)) return close(fd), -2; freeaddrinfo(res); }