Merge "Use the correct value for the DHCP client port number"

This commit is contained in:
Zuul 2020-07-08 13:20:00 +00:00 committed by Gerrit Code Review
commit af603dddfb
4 changed files with 10 additions and 10 deletions

View File

@ -51,7 +51,7 @@ msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
neutron-lib==2.3.0
neutron-lib==2.4.0
openstacksdk==0.31.2
os-client-config==1.28.0
os-ken==0.3.0

View File

@ -45,11 +45,7 @@ from neutron.ipam import utils as ipam_utils
LOG = logging.getLogger(__name__)
UDP = 'udp'
TCP = 'tcp'
DNS_PORT = 53
DHCPV4_PORT = 67
DHCPV6_PORT = 547
METADATA_DEFAULT_IP = '169.254.169.254'
METADATA_SUBNET_CIDR = '169.254.0.0/16'
METADATA_PORT = 80
@ -344,9 +340,13 @@ class Dnsmasq(DhcpLocalProcess):
# on the Neutron port used for DHCP. These are provided as a convenience
# for users of this class.
PORTS = {constants.IP_VERSION_4:
[(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV4_PORT)],
[(constants.PROTO_NAME_UDP, DNS_PORT),
(constants.PROTO_NAME_TCP, DNS_PORT),
(constants.PROTO_NAME_UDP, constants.DHCP_RESPONSE_PORT)],
constants.IP_VERSION_6:
[(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV6_PORT)],
[(constants.PROTO_NAME_UDP, DNS_PORT),
(constants.PROTO_NAME_TCP, DNS_PORT),
(constants.PROTO_NAME_UDP, constants.DHCPV6_RESPONSE_PORT)],
}
_SUBNET_TAG_PREFIX = 'subnet-%s'
@ -1742,7 +1742,7 @@ class DeviceManager(object):
nat=False,
namespace=namespace)
ipv4_rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'
% constants.DHCP_RESPONSE_PORT)
% constants.DHCP_CLIENT_PORT)
ipv6_rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'
% constants.DHCPV6_CLIENT_PORT)
iptables_mgr.ipv4['mangle'].add_rule('POSTROUTING', ipv4_rule)

View File

@ -1860,7 +1860,7 @@ class TestDeviceManager(base.BaseTestCase):
def test_setup_calls_fill_dhcp_udp_checksums_v4(self):
self._test_setup_helper(False)
rule = ('-p udp -m udp --dport %d -j CHECKSUM --checksum-fill'
% const.DHCP_RESPONSE_PORT)
% const.DHCP_CLIENT_PORT)
expected = [mock.call.add_rule('POSTROUTING', rule)]
self.mangle_inst_v4.assert_has_calls(expected)

View File

@ -16,7 +16,7 @@ Jinja2>=2.10 # BSD License (3 clause)
keystonemiddleware>=4.17.0 # Apache-2.0
netaddr>=0.7.18 # BSD
netifaces>=0.10.4 # MIT
neutron-lib>=2.3.0 # Apache-2.0
neutron-lib>=2.4.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0
tenacity>=4.4.0 # Apache-2.0
SQLAlchemy>=1.2.0 # MIT