]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix libvirt upgrade path when nwfilter is used
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Sat, 16 Feb 2013 02:33:37 +0000 (21:33 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Sat, 16 Feb 2013 02:33:37 +0000 (21:33 -0500)
commitb7d00de2bd78c9c2461e289d6674e82da5b234bc
tree4d9822443347c82b26385c64ab6f016f5eeeaf1e
parenta18452d0d2aedf65b83b24983ce5746cfe68e71a
Fix libvirt upgrade path when nwfilter is used

Between revision 65fb9d49 and before this patch, an upgrade of libvirt while
VMs are running and instantiating iptables filtering rules due to nwfilter
rules, may leave stray iptables rules behind when shutting VMs down.
Left-over iptables rules may look like this:

Chain FP-vnet0 (1 references)
target     prot opt source               destination
DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp spt:122
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

[...]

Chain libvirt-out (1 references)
target     prot opt source               destination
FO-vnet0   all  --  0.0.0.0/0            0.0.0.0/0           [goto]  PHYSDEV match --physdev-out vnet0

The reason is that the recent nwfilter code only removed filtering rules in
the libvirt-out chain that contain the --physdev-is-bridged parameter.
Older rules didn't match and were not removed.

Note that the user-defined chain FO-vnet0 could not be removed due to the
reference from the rule in libvirt-out.

Often the work around may be done through

service iptables restart
kill -SIGHUP $(pidof libvirtd)

This patch now also removes older libvirt versions' iptables rules.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
src/nwfilter/nwfilter_ebiptables_driver.c