From d859ca2f9b480e79d715fc70d6aaaf45f0b221d3 Mon Sep 17 00:00:00 2001 From: Kyle Mestery Date: Wed, 24 Jul 2013 13:11:58 +0100 Subject: [PATCH] Allow hostnames to start with a number. --- CHANGELOG | 3 +++ src/util.c | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 78eef33..53df36e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -60,6 +60,9 @@ version 2.67 AudioCodes Voice Gateways doing streaming writes to flash. Thanks to Damian Kaczkowski for spotting the problem. + Allow hostnames to start with a number, as allowed in + RFC-1123. Thanks to Kyle Mestery for the patch. + version 2.66 Add the ability to act as an authoritative DNS diff --git a/src/util.c b/src/util.c index af4031c..94cc570 100644 --- a/src/util.c +++ b/src/util.c @@ -151,14 +151,13 @@ 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 == '_')) + if (!first && (c == '-' || c == '_')) continue; - + /* end of hostname part */ if (c == '.') return 1; -- 2.47.2