8.2.1: wrong master address in slave zone header comment

Paul A Vixie vixie at mibh.net
Thu Aug 19 22:52:47 UTC 1999


> Don't ask me why, but inet_ntoa(local.sin_addr) in fprintf() messes up
> the master's address (Solaris-2.6, gcc).

as other bind-workers have explained, this is because it returns a static,
and calling it twice in the same printf() is a programming error.

> As a work-around:

try this:

--- named-xfer.c        1999/08/11 23:57:11     8.73
+++ named-xfer.c        1999/08/19 22:50:51
@@ -1158,7 +1158,8 @@
                if (badsoa_msg)
                        goto badsoa;
                if (SEQ_GT(zp_start.z_serial, serial_no) || !check_serial) {
-                       const char *l, *nl;
+                       const char *l, *nl, *t;
+
                        dprintf(1, "need update, serial %u\n",
                                zp_start.z_serial);
                        hp = (HEADER *) buf;
@@ -1189,11 +1190,13 @@
                                "; zone '%s'   last serial %u\n":
                                "; zone '%s'   first transfer\n",
                                domain, serial_no);
+                       t = strdup(inet_ntoa(sin.sin_addr));
                        fprintf(dbfp, "; from %s:%d (local %s) using %s at %s",
-                               inet_ntoa(sin.sin_addr), ntohs(sin.sin_port),
+                               t, ntohs(sin.sin_port),
                                inet_ntoa(local.sin_addr),
                                (methode == ISIXFR) ? "IXFR":"AXFR", 
                                ctimel(tt.tv_sec));
+                       free(t);
                        for (;;) {
                                if ((soa_cnt == 0) || (zp->z_type == Z_STUB)) {
                                        if (zp->z_type == Z_STUB) {


More information about the bind-workers mailing list