[libvirt PATCH 11/14] virInterfaceDefParseProtoIPv6: Simplify and cleanup

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/interface_conf.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index c41eecac29..8be439a2a1 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -302,17 +302,14 @@ static int
 virInterfaceDefParseProtoIPv6(virInterfaceProtocolDef *def,
                               xmlXPathContextPtr ctxt)
 {
-    xmlNodePtr dhcp, autoconf;
+    xmlNodePtr dhcp;
     g_autofree xmlNodePtr *ipNodes = NULL;
     int nipNodes;
     size_t i;
-    char *tmp;
 
-    tmp = virXPathString("string(./route[1]/@gateway)", ctxt);
-    def->gateway = tmp;
+    def->gateway = virXPathString("string(./route[1]/@gateway)", ctxt);
 
-    autoconf = virXPathNode("./autoconf", ctxt);
-    if (autoconf != NULL)
+    if (virXPathNode("./autoconf", ctxt) != NULL)
         def->autoconf = 1;
 
     dhcp = virXPathNode("./dhcp", ctxt);
@@ -331,10 +328,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDef *def,
 
     def->nips = 0;
     for (i = 0; i < nipNodes; i++) {
-
-        virInterfaceIPDef *ip;
-
-        ip = g_new0(virInterfaceIPDef, 1);
+        virInterfaceIPDef *ip = g_new0(virInterfaceIPDef, 1);
 
         if (virInterfaceDefParseIP(ip, ipNodes[i]) < 0) {
             virInterfaceIPDefFree(ip);
-- 
2.31.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