bind-9.10.4-P3 の 差分確認

ソースを Diff ってみた。

■bind-9.10.4-P2 と bind-9.10.4-P3 の差分
・差分 Diff の作成

$ diff -uprN ./bind-9.10.4-P2/ ./bind-9.10.4-P3/ > bind-9.10.4-P3.diff
$ diff -uprN ./bind-9.10.4-P2/bin/ ./bind-9.10.4-P3/bin/ > bind-9.10.4-P3_bin.diff
$ diff -uprN ./bind-9.10.4-P2/lib/ ./bind-9.10.4-P3/lib/ > bind-9.10.4-P3_lib.diff
$ diff -uprN ./bind-9.10.4-P2/unit/ ./bind-9.10.4-P3/unit/ > bind-9.10.4-P3_unit.diff
$ diff -uprN ./bind-9.10.4-P2/util/ ./bind-9.10.4-P3/util/ > bind-9.10.4-P3_util.diff
$ ls -la *.diff
-rw-rw-r-- 1 admin admin 39364 Sep 28 03:36 bind-9.10.4-P3.diff
-rw-rw-r-- 1 admin admin     0 Sep 28 03:36 bind-9.10.4-P3_bin.diff
-rw-rw-r-- 1 admin admin  4457 Sep 28 03:36 bind-9.10.4-P3_lib.diff
-rw-rw-r-- 1 admin admin     0 Sep 28 03:36 bind-9.10.4-P3_unit.diff
-rw-rw-r-- 1 admin admin     0 Sep 28 03:36 bind-9.10.4-P3_util.diff

・lib ディレクトリの中身の差分を見てみる

$ cat bind-9.10.4-P3_lib.diff
diff -uprN ./bind-9.10.4-P2/lib/dns/api ./bind-9.10.4-P3/lib/dns/api
--- ./bind-9.10.4-P2/lib/dns/api        2016-07-14 08:58:03.000000000 +0900
+++ ./bind-9.10.4-P3/lib/dns/api        2016-09-14 10:23:44.000000000 +0900
@@ -6,5 +6,5 @@
 # 9.9-sub: 130-139, 150-159
 # 9.10: 140-149, 160-169
 LIBINTERFACE = 165
-LIBREVISION = 1
+LIBREVISION = 2
 LIBAGE = 0
diff -uprN ./bind-9.10.4-P2/lib/dns/message.c ./bind-9.10.4-P3/lib/dns/message.c
--- ./bind-9.10.4-P2/lib/dns/message.c  2016-07-14 08:58:03.000000000 +0900
+++ ./bind-9.10.4-P3/lib/dns/message.c  2016-09-14 10:23:44.000000000 +0900
@@ -1728,7 +1728,7 @@ dns_message_renderbegin(dns_message_t *m
        if (r.length < DNS_MESSAGE_HEADERLEN)
                return (ISC_R_NOSPACE);

-       if (r.length < msg->reserved)
+       if (r.length - DNS_MESSAGE_HEADERLEN < msg->reserved)
                return (ISC_R_NOSPACE);

        /*
@@ -1869,8 +1869,29 @@ norender_rdataset(const dns_rdataset_t *

        return (ISC_TRUE);
 }
-
 #endif
+
+static isc_result_t
+renderset(dns_rdataset_t *rdataset, dns_name_t *owner_name,
+         dns_compress_t *cctx, isc_buffer_t *target,
+         unsigned int reserved, unsigned int options, unsigned int *countp)
+{
+       isc_result_t result;
+
+       /*
+        * Shrink the space in the buffer by the reserved amount.
+        */
+       if (target->length - target->used < reserved)
+               return (ISC_R_NOSPACE);
+
+       target->length -= reserved;
+       result = dns_rdataset_towire(rdataset, owner_name,
+                                    cctx, target, options, countp);
+       target->length += reserved;
+
+       return (result);
+}
+
 isc_result_t
 dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
                          unsigned int options)
@@ -1913,6 +1934,8 @@ dns_message_rendersection(dns_message_t
        /*
         * Shrink the space in the buffer by the reserved amount.
         */
+       if (msg->buffer->length - msg->buffer->used < msg->reserved)
+               return (ISC_R_NOSPACE);
        msg->buffer->length -= msg->reserved;

        total = 0;
@@ -2188,9 +2211,8 @@ dns_message_renderend(dns_message_t *msg
                 * Render.
                 */
                count = 0;
-               result = dns_rdataset_towire(msg->opt, dns_rootname,
-                                            msg->cctx, msg->buffer, 0,
-                                            &count);
+               result = renderset(msg->opt, dns_rootname, msg->cctx,
+                                  msg->buffer, msg->reserved, 0, &count);
                msg->counts[DNS_SECTION_ADDITIONAL] += count;
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -2206,9 +2228,8 @@ dns_message_renderend(dns_message_t *msg
                if (result != ISC_R_SUCCESS)
                        return (result);
                count = 0;
-               result = dns_rdataset_towire(msg->tsig, msg->tsigname,
-                                            msg->cctx, msg->buffer, 0,
-                                            &count);
+               result = renderset(msg->tsig, msg->tsigname, msg->cctx,
+                                  msg->buffer, msg->reserved, 0, &count);
                msg->counts[DNS_SECTION_ADDITIONAL] += count;
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -2229,9 +2250,8 @@ dns_message_renderend(dns_message_t *msg
                 * the owner name of a SIG(0) is irrelevant, and will not
                 * be set in a message being rendered.
                 */
-               result = dns_rdataset_towire(msg->sig0, dns_rootname,
-                                            msg->cctx, msg->buffer, 0,
-                                            &count);
+               result = renderset(msg->sig0, dns_rootname, msg->cctx,
+                                  msg->buffer, msg->reserved, 0, &count);
                msg->counts[DNS_SECTION_ADDITIONAL] += count;
                if (result != ISC_R_SUCCESS)
                        return (result);
diff -uprN ./bind-9.10.4-P2/lib/dns/rdata/generic/opt_41.c ./bind-9.10.4-P3/lib/dns/rdata/generic/opt_41.c
--- ./bind-9.10.4-P2/lib/dns/rdata/generic/opt_41.c     2016-07-14 08:58:03.000000000 +0900
+++ ./bind-9.10.4-P3/lib/dns/rdata/generic/opt_41.c     2016-09-14 10:23:44.000000000 +0900
@@ -134,9 +134,6 @@ fromwire_opt(ARGS_FROMWIRE) {
                        scope = uint8_fromregion(&sregion);
                        isc_region_consume(&sregion, 1);

-                       if (addrlen == 0U && family != 0U)
-                               return (DNS_R_OPTERR);
-
                        switch (family) {
                        case 0:
                                /*
diff -uprN ./bind-9.10.4-P2/lib/dns/tests/rdata_test.c ./bind-9.10.4-P3/lib/dns/tests/rdata_test.c
--- ./bind-9.10.4-P2/lib/dns/tests/rdata_test.c 2016-07-14 08:58:03.000000000 +0900
+++ ./bind-9.10.4-P3/lib/dns/tests/rdata_test.c 2016-09-14 10:23:44.000000000 +0900
@@ -105,7 +105,7 @@ ATF_TC_BODY(edns_client_subnet, tc) {
                          0x00, 0x08, 0x00, 0x04,
                          0x00, 0x01, 0x00, 0x00
                        },
-                       8, ISC_FALSE
+                       8, ISC_TRUE
                },
                {
                        /* Option code family 2 (ipv6) , source 0, scope 0 */
@@ -113,7 +113,7 @@ ATF_TC_BODY(edns_client_subnet, tc) {
                          0x00, 0x08, 0x00, 0x04,
                          0x00, 0x02, 0x00, 0x00
                        },
-                       8, ISC_FALSE
+                       8, ISC_TRUE
                },
                {
                        /* extra octet */

とりあえず目の前に擬人化された BIND がいたら、ほっぺを ふぎゅっ とすればいいのかな。

カテゴリー: めも パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です