From: Roy Marples Date: Sat, 4 Jul 2015 13:33:24 +0000 (+0000) Subject: Refer to the domain name encoding as RFC1035 rather than the RFC for the X-Git-Tag: v6.9.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=167b9b9b7d5aadc9843b3ef396e797f94621289d;p=thirdparty%2Fdhcpcd.git Refer to the domain name encoding as RFC1035 rather than the RFC for the DHCP option which first required it. --- diff --git a/dhcp-common.c b/dhcp-common.c index 33bf6b03..b6339888 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -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; diff --git a/dhcp-common.h b/dhcp-common.h index ba04db47..5a4cfc14 100644 --- a/dhcp-common.h +++ b/dhcp-common.h @@ -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 09e002b5..a413956a 100644 --- 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: diff --git a/if-options.c b/if-options.c index 5d31d9a5..8e5304a3 100644 --- a/if-options.c +++ b/if-options.c @@ -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;