From 52cc1a1a18d179e1cfe042b5131ae936d4c10f39 Mon Sep 17 00:00:00 2001
From: Thomas Pornin <pornin@bolet.org>
Date: Thu, 8 Jun 2017 00:51:55 +0200
Subject: [PATCH] Small fix on sample server code (displaying of IPv6
 addresses).

---
 samples/server_basic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/server_basic.c b/samples/server_basic.c
index 3b4c312..e774c4d 100644
--- a/samples/server_basic.c
+++ b/samples/server_basic.c
@@ -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;
 	}
-- 
2.17.1