]> xenbits.xensource.com Git - libvirt.git/commit
network: call network(Add|Remove)FirewallRules() for forward mode='open'
authorLaine Stump <laine@redhat.com>
Fri, 4 Oct 2024 21:17:59 +0000 (17:17 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 9 Oct 2024 19:54:08 +0000 (15:54 -0400)
commitd552d810b97d478675eac830164349d8a1a35e63
tree9f03c27a20169dec1d436351af54f151aba75f1d
parentef760a413361a8992a3e56884a1ec09290954c71
network: call network(Add|Remove)FirewallRules() for forward mode='open'

Previously networkAddFirewallRules() and networkRemoveFirewallRules()
were only called if the forward mode was none, 'route', or 'nat', so
those functions didn't check the forward mode. Although their current
contents shouldn't be executed for forward mode='open', soon they will
have extra functionality that should be executed for all the current
forward modes and also mode='open'.

This patch modifies all places either of the functions are called to
make sure they are called for mode='open' in addition to current modes
(by either adding 'case ..._OPEN:' to the case of a switch statement,
or just removing an 'if (mode != ...OPEN)' around the calls; to
balance out for that, it puts the entirety of the contents of both
functions inside if (mode != ...OPEN) to retain current behavior. (an
upcoming patch will add code outside that if clause).

debug log messages were also added to make it easier to test that the
right thing is being done in all cases.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/network/bridge_driver.c
src/network/bridge_driver_linux.c