Allow hostnames to start with a number.

This commit is contained in:
Kyle Mestery authored and Simon Kelley committed 2013-07-24 13:17:54 +01:00
1 parent b4b9308079
commit d859ca2f9b
2 files changed
+7 -5

No files matched your search

+3
View File
@@ -60,6 +60,9 @@ version 2.67
AudioCodes Voice Gateways doing streaming writes to flash. AudioCodes Voice Gateways doing streaming writes to flash.
Thanks to Damian Kaczkowski for spotting the problem. 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 version 2.66
Add the ability to act as an authoritative DNS Add the ability to act as an authoritative DNS
+4 -5
View File
@@ -151,14 +151,13 @@ int legal_hostname(char *name)
/* check for legal char a-z A-Z 0-9 - _ . */ /* check for legal char a-z A-Z 0-9 - _ . */
{ {
if ((c >= 'A' && c <= 'Z') || if ((c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z')) (c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9'))
continue; continue;
if (!first && if (!first && (c == '-' || c == '_'))
((c >= '0' && c <= '9') ||
c == '-' || c == '_'))
continue; continue;
/* end of hostname part */ /* end of hostname part */
if (c == '.') if (c == '.')
return 1; return 1;