From 6be2152bc46bcad55980d6adefd3ce46df14fc15 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 22 Jul 2014 18:08:24 +0200 Subject: [PATCH] libbind: allow underscores in domain names As discussed in http://www.freelists.org/post/haiku-development/Proposal-adding-nochecknames-to-resolvconf-by-default The underscore is handled like the hyphen, that is, it can only be in the middle of a word. "a_b.com" is valid, but "a_.com" and "_a.com" are not. Patch is from http://lists.freebsd.org/pipermail/freebsd-arch/2003-March/000071.html --- src/kits/network/libbind/resolv/res_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/network/libbind/resolv/res_comp.c b/src/kits/network/libbind/resolv/res_comp.c index 08a66b21c5..2c8d0fecd9 100644 --- a/src/kits/network/libbind/resolv/res_comp.c +++ b/src/kits/network/libbind/resolv/res_comp.c @@ -140,7 +140,7 @@ dn_skipname(const u_char *ptr, const u_char *eom) { * is not careful about this, but for some reason, we're doing it right here. */ #define PERIOD 0x2e -#define hyphenchar(c) ((c) == 0x2d) +#define hyphenchar(c) ((c) == 0x2d || (c) == 0x5f) #define bslashchar(c) ((c) == 0x5c) #define periodchar(c) ((c) == PERIOD) #define asterchar(c) ((c) == 0x2a)