]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
dhcp fails if extra_dhcp_opts for stateless subnet enabled
authorvenkata anil <anil.venkata@enovance.com>
Wed, 24 Jun 2015 07:33:09 +0000 (07:33 +0000)
committervenkata anil <anil.venkata@enovance.com>
Wed, 24 Jun 2015 07:33:14 +0000 (07:33 +0000)
commit481d9a4f356d325e60e4c208c93693d755097bcd
treee37f6f8d050e562872f5daa7e436145a83c031cc
parent364e7bb4f0fbbf9d11bfb727ccabc40cc48ad9b7
dhcp fails if extra_dhcp_opts for stateless subnet enabled

vm on a network having IPv4 and IPv6 dhcpv6 stateless subnets,
fails to get IPv4 address, when vm uses a port with extra_dhcp_opts.

neutron creates entries in dhcp host file for each subnet of a port.
Each of these entries will have same mac address as first field,
and may have client_id, fqdn, ipv4/ipv6 address for dhcp/dhcpv6 stateful,
or tag as other fields.
For dhcpv6 stateless subnet with extra_dhcp_opts,
host file will have only mac address and tag.

If the last entry in host file for the port with extra_dhcp_opts,
is for dhcpv6 stateless subnet, then dnsmasq tries to use this entry,
(as dnsmasq reads the hosts file from EOF) to resolve
dhcp request even for IPv4, treats as 'no address found'
and fails to send DHCPOFFER.

So we sort the fixed_ips, so that ipv6 subnets for the port are added
first in host file, to avoid this issue.

Change-Id: I3bea58d86a3508e49cbac1d03c6b640836b4a7a2
Closes-bug: #1466144
neutron/agent/linux/dhcp.py
neutron/tests/unit/agent/linux/test_dhcp.py