]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove all vestiges of 16 bit global compression
authorBrian Wellington <source@isc.org>
Thu, 28 Dec 2000 00:43:12 +0000 (00:43 +0000)
committerBrian Wellington <source@isc.org>
Thu, 28 Dec 2000 00:43:12 +0000 (00:43 +0000)
16 files changed:
bin/tests/names/dns_name_fromwire_1_data
bin/tests/names/dns_name_fromwire_2_data
bin/tests/names/dns_name_fromwire_3_data
bin/tests/names/dns_name_fromwire_4_data
bin/tests/names/dns_name_fromwire_5_data
bin/tests/names/dns_name_fromwire_6_data
bin/tests/names/dns_name_fromwire_7_data
bin/tests/names/dns_name_fromwire_8_data
bin/tests/names/dns_name_fromwire_9_data
bin/tests/names/dns_name_towire_1_data
bin/tests/names/dns_name_towire_2_data
bin/tests/names/t_names.c
lib/dns/include/dns/compress.h
lib/dns/include/dns/name.h
lib/dns/name.c
lib/tests/t_api.c

index f32915021909ee4ca1b7116d9608558ff2bb7916..549a8b033e48b62777008032fe2b386be71ff55f 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index fd790c0a7cd84347e0779c63de54a26beb59b67a..d66949055205fdf2301406b2eb4ab0437d6e3b4c 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index 04a163857220109b99b153f027d0d06be38f4786..deeca0a315ba17b2f579d3862e4c3a9db7544c10 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index 4dc9104924167341f671d3550c46ef359e652682..a45855e1730bb5b018f959c5c275ed864da687a4 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index 0803e0df0e14aaea6ea4fc63462eb92c4a41173f..4d2da865c373bee88fd270b37620d1448aaeef5d 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index fdd6ca8dfd25921c116cb0041c98cded8586cae8..39dd88b275e356717d37251e819f3e17b0a2ff63 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index fd13d53344aaa9f53ae177a7ef27d6e8df7930eb..65c02022f4e49281ef8d3d34c3a4c16a1d571b3d 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index b0523abb4ade296bd20db125a1275866c2b8d516..160d9a15d279503d47c038bcb87624361d66e7d4 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index fb92336cbfc1b1269b3e02060921e97a8e8a05fc..22e68387814e3e58b404e4ecc61ce29dd30768a9 100644 (file)
@@ -15,7 +15,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_name is the expected name after any decompression
index a853989fcc51a826ff64759dd73d1fe27438e8a6..60adf11cc78e15b8a5ded5d7865fd415bb712dca 100644 (file)
@@ -9,7 +9,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_data is the expected wire format data in hex format
index 77bfc92eed0194cb68a5844df594d9dfb63fba33..22aa60ecbdb142530c0ff2988085d85b7943109a 100644 (file)
@@ -9,7 +9,6 @@
 #      DNS_COMPRESS_ALL
 #      DNS_COMPRESS_GLOBAL
 #      DNS_COMPRESS_GLOBAL14
-#      DNS_COMPRESS_GLOBAL16
 #      DNS_COMPRESS_NONE
 #
 # and where exp_data is the expected wire format data in hex format
index 28f9eba331f5f6b5509dd493aa98292dfc841734..2dc39ff9e8ecc12cbcc1f34c8b4b820081e61246 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_names.c,v 1.29 2000/11/14 23:29:47 bwelling Exp $ */
+/* $Id: t_names.c,v 1.30 2000/12/28 00:43:12 bwelling Exp $ */
 
 #include <config.h>
 
@@ -2242,8 +2242,6 @@ t_dns_name_fromwire_x(const char *testfile, size_t buflen) {
                                dc_method = DNS_COMPRESS_NONE;
                                if (! strcmp(tok, "DNS_COMPRESS_GLOBAL14"))
                                        dc_method = DNS_COMPRESS_GLOBAL14;
-                               else if (! strcmp(tok,"DNS_COMPRESS_GLOBAL16"))
-                                       dc_method = DNS_COMPRESS_GLOBAL16;
                                else if (! strcmp(tok, "DNS_COMPRESS_GLOBAL"))
                                        dc_method = DNS_COMPRESS_GLOBAL;
                                else if (! strcmp(tok, "DNS_COMPRESS_ALL"))
index 6a0d1cab0aa654f587757515d78bfff9df7ffc80..c466544c7d4d460a2fca8efd9001c0d7a5ac1a47 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: compress.h,v 1.19 2000/11/14 23:29:55 bwelling Exp $ */
+/* $Id: compress.h,v 1.20 2000/12/28 00:42:56 bwelling Exp $ */
 
 #ifndef DNS_COMPRESS_H
 #define DNS_COMPRESS_H 1
@@ -28,8 +28,7 @@ ISC_LANG_BEGINDECLS
 
 #define DNS_COMPRESS_NONE              0x00    /* no compression */
 #define DNS_COMPRESS_GLOBAL14          0x01    /* "normal" compression. */
-#define DNS_COMPRESS_GLOBAL16          0x02    /* 16-bit edns global comp. */
-#define DNS_COMPRESS_GLOBAL            0x03    /* all global comp. */
+#define DNS_COMPRESS_GLOBAL            0x01    /* all global comp. */
 /*
  * Synonymous with DNS_COMPRESS_GLOBAL.  A genuine difference existed when
  * local compression was an IETF draft, but that draft has been retired without
index 42b4ce3841a47a516bf34fa026728abdf30913ec..305f22139facd967447c5635031748e04fc1778a 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: name.h,v 1.82 2000/11/27 19:42:34 gson Exp $ */
+/* $Id: name.h,v 1.83 2000/12/28 00:42:58 bwelling Exp $ */
 
 #ifndef DNS_NAME_H
 #define DNS_NAME_H 1
@@ -93,7 +93,6 @@ ISC_LANG_BEGINDECLS
  *** Extended Label Types
  ***/
 
-#define DNS_LABELTYPE_GLOBALCOMP16     0x40
 #define DNS_LABELTYPE_BITSTRING                0x41
 
 /***
index a4284d1ab40677105647f2f73b968a074f4c1cd2..55c2e1306cdac6dc3b803e040d0bc534ed286700 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: name.c,v 1.109 2000/12/11 19:24:14 bwelling Exp $ */
+/* $Id: name.c,v 1.110 2000/12/28 00:42:55 bwelling Exp $ */
 
 #include <config.h>
 
@@ -2290,16 +2290,6 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
                                *ndata++ = c;
                                saw_bitstring = ISC_TRUE;
                                state = fw_bitstring;
-                       } else if (c == DNS_LABELTYPE_GLOBALCOMP16) {
-                               /*
-                                * 16-bit pointer.
-                                */
-                               if ((dctx->allowed & DNS_COMPRESS_GLOBAL16) ==
-                                   0)
-                                       return (DNS_R_DISALLOWED);
-                               new_current = 0;
-                               n = 2;
-                               state = fw_newcurrent;
                        } else
                                return (DNS_R_BADLABELTYPE);
                        break;
@@ -2430,10 +2420,17 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
        else
                gf = ISC_FALSE;
 
+       /*
+        * If the offset is too high for 14 bit global compression, we're
+        * out of luck.
+        */
+       if (gf && go >= 0x4000)
+               gf = ISC_FALSE;
+
        /*
         * Will the compression pointer reduce the message size?
         */
-       if (gf && (gp.length + ((go < 16384) ? 2 : 3)) >= name->length)
+       if (gf && (gp.length + 2) >= name->length)
                gf = ISC_FALSE;
 
        if (gf) {
@@ -2442,19 +2439,10 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
                (void)memcpy((unsigned char *)target->base + target->used,
                             gp.ndata, (size_t)gp.length);
                isc_buffer_add(target, gp.length);
-               if (go < 16384) {
-                       go |= 0xc000;
-                       if (target->length - target->used < 2)
-                               return (ISC_R_NOSPACE);
-                       isc_buffer_putuint16(target, go);
-               } else {
-                       if (target->length - target->used < 3)
-                               return (ISC_R_NOSPACE);
-                       *((unsigned char*)target->base + target->used) =
-                               DNS_LABELTYPE_GLOBALCOMP16;
-                       isc_buffer_add(target, 1);
-                       isc_buffer_putuint16(target, go);
-               }
+               go |= 0xc000;
+               if (target->length - target->used < 2)
+                       return (ISC_R_NOSPACE);
+               isc_buffer_putuint16(target, go);
                if (gp.length != 0)
                        dns_compress_add(cctx, &gp, &gs, offset);
        } else {
index 119e5d441e3554999944fadf5b72a47edcae7f86..6c6997b4ea336e10ff0ba3cb3a59911af55e8156 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_api.c,v 1.44 2000/11/25 01:20:47 marka Exp $ */
+/* $Id: t_api.c,v 1.45 2000/12/28 00:42:59 bwelling Exp $ */
 
 #include <config.h>
 
@@ -654,7 +654,6 @@ struct dc_method_map {
 
        {       DNS_COMPRESS_NONE,      "DNS_COMPRESS_NONE"     },
        {       DNS_COMPRESS_GLOBAL14,  "DNS_COMPRESS_GLOBAL14" },
-       {       DNS_COMPRESS_GLOBAL16,  "DNS_COMPRESS_GLOBAL16" },
        {       DNS_COMPRESS_GLOBAL,    "DNS_COMPRESS_GLOBAL"   },
        {       DNS_COMPRESS_ALL,       "DNS_COMPRESS_ALL"      },
        {       0,                      NULL                    }