[PATCH] conf: network: Allow hostnames to start with a number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nicolas Lécureuil <neoclust@xxxxxxxxxx>

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@xxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux