Coverity complained that because the cfg->macFilter call checked
net->ifname != NULL before calling ebtablesRemoveForwardAllowIn, then
the virNetDevOpenvswitchRemovePort call should have the same check.
However, if I move the ebtables call prior to the check for TYPE_DIRECT
(where there is a VIR_FREE(net->ifname)), then it seems Coverity is
happy. Since firewall info is tacked on last during setup, removing
it in the opposite order of initialization seems to be natural anyway
qemuDomainReleaseDeviceAddress(vm, &net->info, NULL);
virDomainConfNWFilterTeardown(net);
+ if (cfg->macFilter && (net->ifname != NULL)) {
+ ignore_value(ebtablesRemoveForwardAllowIn(driver->ebtables,
+ net->ifname,
+ &net->mac));
+ }
+
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) {
ignore_value(virNetDevMacVLanDeleteWithVPortProfile(
net->ifname, &net->mac,
VIR_FREE(net->ifname);
}
- if (cfg->macFilter && (net->ifname != NULL)) {
- ignore_value(ebtablesRemoveForwardAllowIn(driver->ebtables,
- net->ifname,
- &net->mac));
- }
-
vport = virDomainNetGetActualVirtPortProfile(net);
if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
ignore_value(virNetDevOpenvswitchRemovePort(