diff options
author | delphij <delphij@FreeBSD.org> | 2008-02-16 00:16:49 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2008-02-16 00:16:49 +0000 |
commit | 653069d3275a6b68475ee6edf42bd95a6116a0b1 (patch) | |
tree | 03d383c7ca7d00dac0f9bba96baab64c6dd347fd /lib/libc/resolv | |
parent | 0841980fe6009008e39ea7223e9be8624ac76c6d (diff) | |
download | FreeBSD-src-653069d3275a6b68475ee6edf42bd95a6116a0b1.zip FreeBSD-src-653069d3275a6b68475ee6edf42bd95a6116a0b1.tar.gz |
Allow underscore in domain names while resolving. While having underscore
is a violation of RFC 1034 [STD 13], it is accepted by certain name servers
as well as other popular operating systems' resolver library.
Bugs are mine.
Obtained from: ume
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/resolv')
-rw-r--r-- | lib/libc/resolv/res_comp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/resolv/res_comp.c b/lib/libc/resolv/res_comp.c index 35d6231..a00755f 100644 --- a/lib/libc/resolv/res_comp.c +++ b/lib/libc/resolv/res_comp.c @@ -140,6 +140,7 @@ dn_skipname(const u_char *ptr, const u_char *eom) { #define PERIOD 0x2e #define hyphenchar(c) ((c) == 0x2d) #define bslashchar(c) ((c) == 0x5c) +#define underscorechar(c) ((c) == 0x5f) #define periodchar(c) ((c) == PERIOD) #define asterchar(c) ((c) == 0x2a) #define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ @@ -147,7 +148,7 @@ dn_skipname(const u_char *ptr, const u_char *eom) { #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) #define borderchar(c) (alphachar(c) || digitchar(c)) -#define middlechar(c) (borderchar(c) || hyphenchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c)) #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) int |