The networkStartNetworkVirtual() function handles starting of
networks of different forward types (none, nat, route, open).
And as a part of startup process dnsmasq might be spawned but
doesn't have to be (depending on the network configuration). The
@dnsmasqStarted variable is supposed to track whether dnsmasq was
started or not (so that it can be killed when starting network
fails after it was started). But the variable is set even when
the code decided not to start it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
/* start dnsmasq if there are any IP addresses (v4 or v6) */
- if ((v4present || v6present) &&
- networkStartDhcpDaemon(driver, obj) < 0)
- goto error;
+ if (v4present || v6present) {
+ if (networkStartDhcpDaemon(driver, obj) < 0)
+ goto error;
- dnsmasqStarted = true;
+ dnsmasqStarted = true;
+ }
if (virNetDevBandwidthSet(def->bridge, def->bandwidth, true, true) < 0)
goto error;