[libvirt] [PATCH] Optimization of the check for valid interface name

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

 



The attached patch optimizes the validation of the name of an interface.

Signed-off-by: Stefan Berger

Index: libvirt-acl/src/conf/domain_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/domain_conf.c
+++ libvirt-acl/src/conf/domain_conf.c
@@ -1795,7 +1795,7 @@ cleanup:
 
 static bool
 isValidIfname(const char *ifname) {
-    return (strspn(ifname, VALID_IFNAME_CHARS) == strlen(ifname));
+    return ifname[strspn(ifname, VALID_IFNAME_CHARS)] == 0;
 }
 
 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]