Skip to content

Commit 5c051a6

Browse files
committed
Fix incorrect masquerade rules in multivip LBs
The up scripts of the interface files were called only when the interface moved from down to up, it means that they were not called during the update of the configuration of an interface. So if during an update, if an ipv6 subnet was plugged while the ipv4 subnet was already there, the up script that sets the masquerade rules was not called. It broke connectivity for either ipv4 or ipv6 between the client and the members in UDP listeners in multivip load balancers. Closes-Bug: #2037943 Change-Id: Iad78de1764bc3a3f699b5feef9e58999d2efe613
1 parent 05616ab commit 5c051a6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

octavia/amphorae/backends/utils/interface.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,10 @@ def _rules_up(self, interface, ipr, idx):
356356
**rule)
357357

358358
def _scripts_up(self, interface, current_state):
359-
if current_state == consts.IFACE_DOWN:
360-
for script in interface.scripts[consts.IFACE_UP]:
361-
LOG.debug("%s: Running command '%s'",
362-
interface.name, script[consts.COMMAND])
363-
subprocess.check_output(script[consts.COMMAND].split())
359+
for script in interface.scripts[consts.IFACE_UP]:
360+
LOG.debug("%s: Running command '%s'",
361+
interface.name, script[consts.COMMAND])
362+
subprocess.check_output(script[consts.COMMAND].split())
364363

365364
def down(self, interface):
366365
LOG.info("Setting interface %s down", interface.name)

octavia/tests/unit/amphorae/backends/utils/test_interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,9 @@ def test_up_update(self, mock_wait_tentative, mock_check_output,
714714
table=254,
715715
family=socket.AF_INET)])
716716

717-
mock_check_output.assert_not_called()
717+
mock_check_output.assert_has_calls([
718+
mock.call(["post-up", "eth1"])
719+
])
718720

719721
@mock.patch('pyroute2.IPRoute.rule')
720722
@mock.patch('pyroute2.IPRoute.route')
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed an issue when using UDP listeners in dual-stack (IPv4 and IPv6) load
5+
balancers, some masquerade rules needed by UDP were not correctly set on the
6+
member interfaces.

0 commit comments

Comments
 (0)