]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
#1204 failed to set sin_len
authorMark Andrews <marka@isc.org>
Tue, 26 Feb 2002 05:03:10 +0000 (05:03 +0000)
committerMark Andrews <marka@isc.org>
Tue, 26 Feb 2002 05:03:10 +0000 (05:03 +0000)
lib/bind/resolv/res_update.c

index 628165d04fa1df6426c7c964683b16a200922489..cf5234c72cd3fe1b8b90bae98596d0e83fd12c8f 100644 (file)
@@ -1,5 +1,5 @@
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_update.c,v 1.7 2002/02/15 04:17:35 marka Exp $";
+static const char rcsid[] = "$Id: res_update.c,v 1.8 2002/02/26 05:03:10 marka Exp $";
 #endif /* not lint */
 
 /*
@@ -100,6 +100,7 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in, ns_tsig_key *key) {
 
        /* Thread all of the updates onto a list of groups. */
        INIT_LIST(zgrps);
+       memset(&tgrp, 0, sizeof (tgrp));
        for (rrecp = rrecp_in; rrecp;
             rrecp = LINKED(rrecp, r_link) ? NEXT(rrecp, r_link) : NULL) {
                struct in_addr addrs[MAXNS];
@@ -120,8 +121,14 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in, ns_tsig_key *key) {
                        goto done;
                }
                for (i = 0; i < nscnt; i++) {
+                       memset(&tgrp.z_nsaddrs[i], 0,
+                              sizeof(tgrp.z_nsaddrs[i]));
                        tgrp.z_nsaddrs[i].sin.sin_addr = addrs[i];
                        tgrp.z_nsaddrs[i].sin.sin_family = AF_INET;
+#ifdef HAVE_SA_LEN
+                       tgrp.z_nsaddrs[i].sin.sin_len =
+                                        sizeof(tgrp.z_nsaddrs[i].sin);
+#endif
                        tgrp.z_nsaddrs[i].sin.sin_port = htons(53);
                }
                tgrp.z_nscount = nscnt;