kern/54189: [dns] resolver should resolve hostnames with underscores

Pav Lucistnik pav at FreeBSD.org
Mon Jun 6 21:20:32 GMT 2005


The following reply was made to PR kern/54189; it has been noted by GNATS.

From: Pav Lucistnik <pav at FreeBSD.org>
To: lennox at cs.columbia.edu, bug-followup at FreeBSD.org
Cc:  
Subject: Re: kern/54189: [dns] resolver should resolve hostnames with
	underscores
Date: Mon, 06 Jun 2005 23:18:18 +0200

 Patch to allow underscores as "middlechars" in domain names. Works for me.
 
 
 --- /home/pav/res_comp.c	Mon Jun  6 23:13:29 2005
 +++ net/res_comp.c	Mon Jun  6 23:08:14 2005
 @@ -143,6 +143,7 @@
   */
  #define PERIOD 0x2e
  #define	hyphenchar(c) ((c) == 0x2d)
 +#define underscorechar(c)  ((c) == 0x5f)
  #define bslashchar(c) ((c) == 0x5c)
  #define periodchar(c) ((c) == PERIOD)
  #define asterchar(c) ((c) == 0x2a)
 @@ -151,7 +152,7 @@
  #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
 
 
 -- 
 Pav Lucistnik <pav at oook.cz>
               <pav at FreeBSD.org>
 
 Thank God we're theoretical physicists so we don't have to get our
 hands dirty with particle accelerators and other heavy machinery.


More information about the freebsd-bugs mailing list