[Dnsmasq-discuss] [PATCH] Fix compliance with RFC 1123
Simon Kelley
simon at thekelleys.org.uk
Wed Jul 24 13:19:29 BST 2013
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.....
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list