]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Remove useless condition in networkRadvdConfContents
authorJán Tomko <jtomko@redhat.com>
Fri, 27 Jun 2014 09:21:06 +0000 (11:21 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 3 Jul 2014 08:41:15 +0000 (10:41 +0200)
If v6present is false, this code is not reachable.
Also, there is no need to check for errors twice.

src/network/bridge_driver.c

index 8624f1e77c349556d49805e0a68b7a926dae279f..149a8fdb25522478b20059e5177076809917e75b 100644 (file)
@@ -1535,20 +1535,15 @@ networkRadvdConfContents(virNetworkObjPtr network, char **configstr)
         VIR_FREE(netaddr);
     }
 
-    /* only create the string if we found at least one IPv6 address */
-    if (v6present) {
-        virBufferAddLit(&configbuf, "};\n");
+    virBufferAddLit(&configbuf, "};\n");
 
-        if (virBufferError(&configbuf)) {
-            virReportOOMError();
-            goto cleanup;
-        }
-        if (!(*configstr = virBufferContentAndReset(&configbuf))) {
-            virReportOOMError();
-            goto cleanup;
-        }
+    if (virBufferError(&configbuf)) {
+        virReportOOMError();
+        goto cleanup;
     }
 
+    *configstr = virBufferContentAndReset(&configbuf);
+
     ret = 0;
  cleanup:
     virBufferFreeAndReset(&configbuf);