Fixed displaying of IPv6 addresses.
[BearSSL] / 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:
                                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;
                }
                                tmp, sizeof tmp);
                        break;
                }