Small fix on sample server code (displaying of IPv6 addresses).

This commit is contained in:
Thomas Pornin 2017-06-08 00:51:55 +02:00
parent d021b7eb7f
commit 52cc1a1a18

View file

@ -204,8 +204,8 @@ accept_client(int server_fd)
tmp, sizeof tmp);
break;
case AF_INET6:
name = inet_ntop(AF_INET,
&((struct sockaddr_in *)&sa)->sin_addr,
name = inet_ntop(AF_INET6,
&((struct sockaddr_in6 *)&sa)->sin6_addr,
tmp, sizeof tmp);
break;
}