From: Nicolas Lécureuil Date: Fri, 14 Jan 2022 11:02:08 +0000 (+0100) Subject: conf: network: Allow hostnames to start with a number X-Git-Tag: v8.1.0-rc1~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=673b74be5fda928da5e9f3c2cfbf6c1cb1eda0c6;p=thirdparty%2Flibvirt.git conf: network: Allow hostnames to start with a number 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 Reviewed-by: Peter Krempa --- 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);