put ifdefs around IPV6 only part. Fixes #184

This commit is contained in:
R.E. Wolff 2017-01-18 00:04:26 +01:00
parent c4c4ef8e55
commit 7476ad564e

View File

@ -528,11 +528,13 @@ static void net_find_local_address(void)
to succeed.
*/
if (remotesockaddr->sa_family == AF_INET6) {
#ifdef ENABLE_IPV6
addr_length = sizeof(struct sockaddr_in6);
memcpy(&remote_sockaddr, rsa6, addr_length);
remote6 = (struct sockaddr_in6 *)&remote_sockaddr;
remote6->sin6_port = htons(1);
#endif
} else {
addr_length = sizeof(struct sockaddr_in);