]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Only attempt removal of the rule allowing tftp if it was added
authorLaine Stump <laine@laine.org>
Thu, 28 Oct 2010 02:45:43 +0000 (22:45 -0400)
committerLaine Stump <laine@laine.org>
Thu, 28 Oct 2010 13:54:47 +0000 (09:54 -0400)
During virtual network startup, the iptables rule that allows tftp
traffic is only added if network->def->tftproot is non-empty, but when
the virtual network is destroyed, we had been unconditionally trying
to delete the rule. This was harmless, except that it created a bogus
error message.

This patch conditionalizes the delete command in the same manner that
the insert command is already conditionalized.

src/network/bridge_driver.c

index 0777d850294c89121c5d29a3e561265fe07850c9..631fbf1f68ba29b4f355c1f40c2874c89fa91316 100644 (file)
@@ -990,7 +990,8 @@ networkRemoveIptablesRules(struct network_driver *driver,
     iptablesRemoveForwardAllowCross(driver->iptables, network->def->bridge);
     iptablesRemoveForwardRejectIn(driver->iptables, network->def->bridge);
     iptablesRemoveForwardRejectOut(driver->iptables, network->def->bridge);
-    iptablesRemoveUdpInput(driver->iptables, network->def->bridge, 69);
+    if (network->def->tftproot)
+        iptablesRemoveUdpInput(driver->iptables, network->def->bridge, 69);
     iptablesRemoveUdpInput(driver->iptables, network->def->bridge, 53);
     iptablesRemoveTcpInput(driver->iptables, network->def->bridge, 53);
     iptablesRemoveUdpInput(driver->iptables, network->def->bridge, 67);