Commit d859ca2f authored by Kyle Mestery's avatar Kyle Mestery Committed by Simon Kelley

Allow hostnames to start with a number.

parent b4b93080
...@@ -60,6 +60,9 @@ version 2.67 ...@@ -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
......
...@@ -151,14 +151,13 @@ int legal_hostname(char *name) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment