Merge "Trivial: check if ipv6 is available for IptablesManager" into stable/ussuri

changes/71/806571/1
Zuul 1 year ago committed by Gerrit Code Review
commit 8e581d31cd
  1. 6
      neutron/agent/linux/dhcp.py
  2. 4
      neutron/agent/ovn/metadata/agent.py

@ -1799,9 +1799,9 @@ class DeviceManager(object):
def fill_dhcp_udp_checksums(self, namespace):
"""Ensure DHCP reply packets always have correct UDP checksums."""
iptables_mgr = iptables_manager.IptablesManager(use_ipv6=True,
nat=False,
namespace=namespace)
iptables_mgr = iptables_manager.IptablesManager(
use_ipv6=netutils.is_ipv6_enabled(), nat=False,
namespace=namespace)
ipv4_rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'
% constants.DHCP_RESPONSE_PORT)
ipv6_rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'

@ -18,6 +18,7 @@ import re
from neutron_lib import constants as n_const
from oslo_concurrency import lockutils
from oslo_log import log
from oslo_utils import netutils
from oslo_utils import uuidutils
from ovsdbapp.backend.ovs_idl import event as row_event
from ovsdbapp.backend.ovs_idl import vlog
@ -372,7 +373,8 @@ class MetadataAgent(object):
return
iptables_mgr = iptables_manager.IptablesManager(
use_ipv6=True, nat=False, namespace=namespace, external_lock=False)
use_ipv6=netutils.is_ipv6_enabled(), nat=False,
namespace=namespace, external_lock=False)
rule = '-p tcp -m tcp -j CHECKSUM --checksum-fill'
iptables_mgr.ipv4['mangle'].add_rule('POSTROUTING', rule, wrap=False)
iptables_mgr.apply()

Loading…
Cancel
Save