Fixed displaying of IPv6 addresses.
authorThomas Pornin <pornin@bolet.org>
Sat, 12 Nov 2016 13:43:05 +0000 (14:43 +0100)
committerThomas Pornin <pornin@bolet.org>
Sat, 12 Nov 2016 13:43:05 +0000 (14:43 +0100)
tools/server.c

index 89d529b..a631982 100644 (file)
@@ -161,8 +161,8 @@ accept_client(int server_fd, int verbose)
                                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;
                }