]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: properly update iptables rules during net-update
authorLaine Stump <laine@laine.org>
Wed, 27 Nov 2013 15:07:34 +0000 (17:07 +0200)
committerLaine Stump <laine@laine.org>
Thu, 28 Nov 2013 14:55:20 +0000 (16:55 +0200)
commit54f9492353170b1ffc78a44c06ed3f9ecaab6ccf
treec5a5b3f8659c84e13ca351dc4128105193c63bc8
parent84fd470d3d8c8e27abca8b2f3fc601c7cd58eadb
network: properly update iptables rules during net-update

This patch resolves:

  https://bugzilla.redhat.com/show_bug.cgi?id=1035336

The basic problem is that during a network update, the required
iptables rules sometimes change, and this was being handled by simply
removing and re-adding the rules. However, the removal of the old
rules was done based on the *new* state of the network, which would
mean that some of the rules would not match those currently in the
system, so the old rules wouldn't be removed.

This patch removes the old rules prior to updating the network
definition then adds the new rules as soon as the definition is
updated. Note that this could lead to a stray packet or two during the
interim, but that was already a problem before (the period of limbo is
now just slightly longer).

While moving the location for the rules, I added a few more sections
that should result in the iptables rules being redone:

DHCP_RANGE and DHCP_HOST - these are needed because adding/removing a dhcp
host entry could lead to the dhcp service being started/stopped, which
would require that the mangle rule that fixes up dhcp response
checksums sould need to be added/removed, and this wasn't being done.
src/network/bridge_driver.c