]> xenbits.xensource.com Git - libvirt.git/commit
network: don't "refresh" iptables rules on rule-less networks
authorLaine Stump <laine@laine.org>
Fri, 21 Sep 2012 19:28:11 +0000 (15:28 -0400)
committerLaine Stump <laine@laine.org>
Sat, 22 Sep 2012 00:10:43 +0000 (20:10 -0400)
commit36ba0ee7b911a0f6536d7c4601afb2cc7a0e9d38
tree5f9fb1f5655d8d240fd806bf17fa97dc3d62ee1a
parentfca338a06c54f272f05aa12e362279e113130284
network: don't "refresh" iptables rules on rule-less networks

The bridge driver implementation of virNetworkUpdate() removes and
re-adds iptables rules any time a network has an <ip>, <forward>, or
<forward>/<interface> element updated. There are some types of
networks that have those elements and yet have no iptables rules
associated with them, and unfortunately the functions that remove/add
iptables rules don't check the type of network before attempting to
remove/add the rules, sometimes leading to an erroneous failure of the
entire update operation.

Under normal circumstances I would refactor the lower level functions
to be more robust, but to avoid code churn as much as possible, I've
just added extra checks directly to networkUpdate().
src/network/bridge_driver.c