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
This commit is contained in:
Adrien Destugues 2014-07-22 18:08:24 +02:00
parent 807bd20a8f
commit 6be2152bc4

View File

@ -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)