(send_vc): Pass correct sockaddr size to connect.
authordrepper <drepper>
Sun, 21 Aug 2005 23:07:10 +0000 (23:07 +0000)
committerdrepper <drepper>
Sun, 21 Aug 2005 23:07:10 +0000 (23:07 +0000)
resolv/res_send.c

index 6f12b88..86c4f1e 100644 (file)
@@ -654,7 +654,9 @@ send_vc(res_state statp,
                }
                __set_errno (0);
                if (connect(statp->_vcsock, (struct sockaddr *)nsap,
-                           sizeof *nsap) < 0) {
+                           nsap->sin6_family == AF_INET
+                           ? sizeof (struct sockaddr_in)
+                           : sizeof (struct sockaddr_in6)) < 0) {
                        *terrno = errno;
                        Aerror(statp, stderr, "connect/vc", errno,
                               (struct sockaddr *) nsap);