From 3c73beebca8f7e5b6802303416e8a96d37dbfbce Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 1 Aug 2018 13:35:51 +0200 Subject: [PATCH] viriscsi: Request more random bits for interface name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In virStorageBackendCreateIfaceIQN() the virRandomBits() is called in order to use random bits to generate random name for new interface. However, virAsprintf() is expecting 32 bits and we are requesting only 30. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé Reviewed-by: Pino Toscano --- src/util/viriscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index 653b4fd932..f00aeb53a7 100644 --- a/src/util/viriscsi.c +++ b/src/util/viriscsi.c @@ -221,7 +221,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn, if (virAsprintf(&temp_ifacename, "libvirt-iface-%08llx", - (unsigned long long)virRandomBits(30)) < 0) + (unsigned long long)virRandomBits(32)) < 0) return -1; VIR_DEBUG("Attempting to create interface '%s' with IQN '%s'",