From: Ján Tomko Date: Fri, 27 Jun 2014 09:21:06 +0000 (+0200) Subject: Remove useless condition in networkRadvdConfContents X-Git-Tag: v1.2.7-rc1~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0979aaf846b8ac4744340664c2c0fb7fbf32ed8d;p=thirdparty%2Flibvirt.git Remove useless condition in networkRadvdConfContents If v6present is false, this code is not reachable. Also, there is no need to check for errors twice. --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8624f1e77c..149a8fdb25 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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);