Use the correct value for the DHCP client port number
Version 2.4.0 of neutron-lib has the DHCP port numbers correct, so start using them. Also updated other code in linux/dhcp.py to use the constants as well, instead of re-defining them. Closes-bug: #1882588 Change-Id: I5dc1d8e7bcc94efd1fab68d980d60e3130d5e5bc
This commit is contained in:
parent
efcc60ddec
commit
0ffaac1db2
@ -50,7 +50,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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user