]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Refer to the domain name encoding as RFC1035 rather than the RFC for the
authorRoy Marples <roy@marples.name>
Sat, 4 Jul 2015 13:33:24 +0000 (13:33 +0000)
committerRoy Marples <roy@marples.name>
Sat, 4 Jul 2015 13:33:24 +0000 (13:33 +0000)
DHCP option which first required it.

dhcp-common.c
dhcp-common.h
dhcp.c
if-options.c

index 33bf6b0321db322228762a821daf90a532bff225..b633988865cfd24cea68fcfdd5363b9f04ef52a3 100644 (file)
@@ -87,7 +87,7 @@ dhcp_print_option_encoding(const struct dhcp_opt *opt, int cols)
                printf(" flag");
        else if (opt->type & BITFLAG)
                printf(" bitflags");
-       else if (opt->type & RFC3397)
+       else if (opt->type & RFC1035)
                printf(" domain");
        else if (opt->type & DOMAIN)
                printf(" dname");
@@ -273,12 +273,12 @@ encode_rfc1035(const char *src, uint8_t *dst)
        return len;
 }
 
-/* Decode an RFC3397 DNS search order option into a space
+/* Decode an RFC1035 DNS search order option into a space
  * separated string. Returns length of string (including
  * terminating zero) or zero on error. out may be NULL
  * to just determine output length. */
 ssize_t
-decode_rfc3397(char *out, size_t len, const uint8_t *p, size_t pl)
+decode_rfc1035(char *out, size_t len, const uint8_t *p, size_t pl)
 {
        const char *start;
        size_t start_len, l, count;
@@ -613,15 +613,15 @@ print_option(char *s, size_t len, const struct dhcp_opt *opt,
        UNUSED(ifname);
 #endif
 
-       if (opt->type & RFC3397) {
-               sl = decode_rfc3397(NULL, 0, data, dl);
+       if (opt->type & RFC1035) {
+               sl = decode_rfc1035(NULL, 0, data, dl);
                if (sl == 0 || sl == -1)
                        return sl;
                l = (size_t)sl + 1;
                tmp = malloc(l);
                if (tmp == NULL)
                        return -1;
-               decode_rfc3397(tmp, l, data, dl);
+               decode_rfc1035(tmp, l, data, dl);
                sl = print_string(s, len, opt->type, (uint8_t *)tmp, l - 1);
                free(tmp);
                return sl;
index ba04db4739f16c7c23c1f92ca1c1822f2449e262..5a4cfc142506bd17b0d40900207f5b9cf57b533e 100644 (file)
@@ -50,7 +50,7 @@
 #define STRING         (1 << 7)
 #define ARRAY          (1 << 8)
 #define RFC3361                (1 << 9)
-#define RFC3397                (1 << 10)
+#define RFC1035                (1 << 10)
 #define RFC3442                (1 << 11)
 #define RFC5969                (1 << 12)
 #define ADDRIPV6       (1 << 13)
@@ -104,7 +104,7 @@ int make_option_mask(const struct dhcp_opt *, size_t,
     uint8_t *, const char *, int);
 
 size_t encode_rfc1035(const char *src, uint8_t *dst);
-ssize_t decode_rfc3397(char *, size_t, const uint8_t *, size_t);
+ssize_t decode_rfc1035(char *, size_t, const uint8_t *, size_t);
 ssize_t print_string(char *, size_t, int, const uint8_t *, size_t);
 int dhcp_set_leasefile(char *, size_t, int, const struct interface *);
 
diff --git a/dhcp.c b/dhcp.c
index 09e002b5c9cae51e54c2ddec9bca8eae8452f23f..a413956a8eab83de9c8c38c5dd9799fede61acfc 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -428,12 +428,12 @@ decode_rfc3361(const uint8_t *data, size_t dl)
        dl--;
        switch (enc) {
        case 0:
-               if ((r = decode_rfc3397(NULL, 0, data, dl)) > 0) {
+               if ((r = decode_rfc1035(NULL, 0, data, dl)) > 0) {
                        l = (size_t)r;
                        sip = malloc(l);
                        if (sip == NULL)
                                return 0;
-                       decode_rfc3397(sip, l, data, dl);
+                       decode_rfc1035(sip, l, data, dl);
                }
                break;
        case 1:
index 5d31d9a5ca365960d05b8b5427a03a8d68fa7947..8e5304a336c7cde90c24eb463cefd0526a56c4d2 100644 (file)
@@ -1634,7 +1634,7 @@ err_sla:
                else if (strcasecmp(arg, "ascii") == 0)
                        t |= STRING | ASCII;
                else if (strcasecmp(arg, "domain") == 0)
-                       t |= STRING | DOMAIN | RFC3397;
+                       t |= STRING | DOMAIN | RFC1035;
                else if (strcasecmp(arg, "dname") == 0)
                        t |= STRING | DOMAIN;
                else if (strcasecmp(arg, "binhex") == 0)
@@ -1661,7 +1661,7 @@ err_sla:
                        l = 0;
                }
                if (t & ARRAY && t & (STRING | BINHEX) &&
-                   !(t & (RFC3397 | DOMAIN)))
+                   !(t & (RFC1035 | DOMAIN)))
                {
                        logger(ctx, LOG_WARNING, "ignoring array for strings");
                        t &= ~ARRAY;