[Dnsmasq-discuss] [PATCH] Fix compliance with RFC 1123

Kyle Mestery (kmestery) kmestery at cisco.com
Wed Jul 24 14:33:27 BST 2013


On Jul 24, 2013, at 7:19 AM, Simon Kelley <simon at thekelleys.org.uk> wrote:
> On 23/07/13 20:49, Kyle Mestery wrote:
>> RFC 1123 permits hostnames to start with numbers. This patch
>> fixes this in dnsmasq so it follows the RFC and allows hostnames to start
>> with numbers.
>> 
>> Signed-off-by: Kyle Mestery<kmestery at cisco.com>
>> ---
>>  src/util.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/src/util.c b/src/util.c
>> index af4031c..759099c 100644
>> --- a/src/util.c
>> +++ b/src/util.c
>> @@ -151,12 +151,12 @@ int legal_hostname(char *name)
>>      /* check for legal char a-z A-Z 0-9 - _ . */
>>      {
>>        if ((c>= 'A'&&  c<= 'Z') ||
>> -	  (c>= 'a'&&  c<= 'z'))
>> +	  (c>= 'a'&&  c<= 'z') ||
>> +	  (c>= '0'&&  c<= '9'))
>>  	continue;
>> 
>>        if (!first&&
>> -	  ((c>= '0'&&  c<= '9') ||
>> -	   c == '-' || c == '_'))
>> +	  (c == '-' || c == '_'))
>>  	continue;
>> 
>>        /* end of hostname part */
> 
> Patch taken. Many thanks. I'm amazed nobody has complained before.....
> 
Great, thanks! Will this show up in the master git repository soon then?

> 
> Cheers,
> 
> Simon.
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss





More information about the Dnsmasq-discuss mailing list