Altre correzioni alle funzioni, con riscrittura di ip_ntop per usare switch,
[gapil.git] / listati / mygetaddr.c
index 2332b139f2bcf3d436d4044960c2f18b71aa7d00..ecb81df3f41c99b7a1a0f5d4ccb044240c0f98b5 100644 (file)
@@ -20,7 +20,7 @@
                               buffer, sizeof(buffer));
        } else if (ptr->ai_family == PF_INET6) {      /* if IPv6 */
            printf("IPv6 address: \n");
-           addr6 = (struct sockaddr_in *) ptr->ai_addr;    /* address */
+           addr6 = (struct sockaddr_in6 *) ptr->ai_addr;   /* address */
            port = ntohs(addr6->sin6_port);                 /* port */
            string = inet_ntop(addr6->sin6_family, &addr6->sin6_addr, 
                               buffer, sizeof(buffer));