Merge "Trivial: check if ipv6 is available for IptablesManager"
This commit is contained in:
commit
891a715e4f
|
@ -1761,9 +1761,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_CLIENT_PORT)
|
||||
ipv6_rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'
|
||||
|
|
|
@ -20,6 +20,7 @@ import uuid
|
|||
from neutron_lib import constants as n_const
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_log import log
|
||||
from oslo_utils import netutils
|
||||
from ovsdbapp.backend.ovs_idl import event as row_event
|
||||
from ovsdbapp.backend.ovs_idl import vlog
|
||||
import tenacity
|
||||
|
@ -391,7 +392,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…
Reference in New Issue