Small fix on sample server code (displaying of IPv6 addresses).
authorThomas Pornin <pornin@bolet.org>
Wed, 7 Jun 2017 22:51:55 +0000 (00:51 +0200)
committerThomas Pornin <pornin@bolet.org>
Wed, 7 Jun 2017 22:51:55 +0000 (00:51 +0200)
samples/server_basic.c

index 3b4c312..e774c4d 100644 (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;
        }