From: Nicolas Lécureuil <neoclust(a)mageia.org>
RFC952 mandated that hostnames would start with an alpha character.
This requirement was later relaxed by RFC1123 which allowed hostnames to
start with a number as well.
https://datatracker.ietf.org/doc/html/rfc952
https://datatracker.ietf.org/doc/html/rfc1123#page-13
Signed-off-by: Nicolas Lécureuil <nicolas.lecureuil(a)siveo.net>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed after review of a trivial merge request.
src/conf/network_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 10d3330fdf..c769bbaeb5 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -548,7 +548,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName,
}
name = virXMLPropString(node, "name");
- if (name && (!g_ascii_isalpha(name[0]))) {
+ if (name && !(g_ascii_isalpha(name[0]) || g_ascii_isdigit(name[0]))) {
virReportError(VIR_ERR_XML_ERROR,
_("Cannot use host name '%s' in network
'%s'"),
name, networkName);
--
2.34.1