X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2Fmygetaddr.c;h=b33f9c29db379154602a29a6896fdec5578ad326;hp=ca01d74d6a9d951d6ea5c55e44e491d687ae94a6;hb=5a12d423b85ac5decb966bc3c3a797b3ad9a7a3f;hpb=c19330d1e61698f1758d5bf9d340955e1d4d876b diff --git a/sources/mygetaddr.c b/sources/mygetaddr.c index ca01d74..b33f9c2 100644 --- a/sources/mygetaddr.c +++ b/sources/mygetaddr.c @@ -18,7 +18,7 @@ */ /***************************************************************************** * - * File mygetaddr.c: An example host command + * File mygetaddr.c: An example for getaddrinfo program * * Author: S. Piccardi Nov. 2004 * @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) 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));