diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index d6def63446fa..a7ab1286eec6 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -861,8 +861,8 @@ matchlen(src, dst) break; #endif case AF_INET: - s = (u_char *)&((struct sockaddr_in6 *)src)->sin6_addr; - d = (u_char *)&((struct sockaddr_in6 *)dst)->sin6_addr; + s = (u_char *)&((struct sockaddr_in *)src)->sin_addr; + d = (u_char *)&((struct sockaddr_in *)dst)->sin_addr; addrlen = sizeof(struct in_addr); lim = s + addrlen; break; diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 4bbc5f094cde..611dea734e47 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -1028,8 +1028,8 @@ matchlen(src, dst) break; #endif case AF_INET: - s = (u_char *)&((struct sockaddr_in6 *)src)->sin6_addr; - d = (u_char *)&((struct sockaddr_in6 *)dst)->sin6_addr; + s = (u_char *)&((struct sockaddr_in *)src)->sin_addr; + d = (u_char *)&((struct sockaddr_in *)dst)->sin_addr; addrlen = sizeof(struct in_addr); lim = s + addrlen; break;