Reviewed: https://review.openstack.org/630951 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4747de23d80ab32eea073846221adf94987f755b Submitter: Zuul Branch: master
commit 4747de23d80ab32eea073846221adf94987f755b Author: Rodolfo Alonso Hernandez <[email protected]> Date: Mon Jan 14 18:47:21 2019 +0000 Remove IPv6 addresses in dnsmasq leases file IPv6 address format in dnsmasq leases file is incorrect (correct format is described in bug description). This bad formatting generates the following error when initializing dnsmasq: dnsmasq[20603]: failed to parse lease database, invalid line: \ 1547121093 fa:16:3e:a0:3a:9a [fd5b:1fd5:8295:5339::43] * ... This patch removes the IPv6 addresses from the leases file, as proposed in the bug, because the DHCP agent does not have the IAID (identity association identifier) of each IPv6 address assigned. In case of agent restart, dnsmasq won't have any IPv6 address in the leases file, but the hosts file and the additional hosts file will contain all MAC/IPv6 previous assignations. When the IPv6 client sends a DHCPDISCOVER, dnsmasq will offer the same IPv6 address to this client. At the same time, the client will request to the server the same address: DHCPDISCOVER(tap2c14823a-e6) fa:16:3e:54:c6:8e DHCPOFFER(tap2c14823a-e6) fd5b:1fd5:8295:5339::43 fa:16:3e:54:c6:8e DHCPREQUEST(tap2c14823a-e6) fd5b:1fd5:8295:5339::43 fa:16:3e:54:c6:8e DHCPACK(tap2c14823a-e6) fd5b:1fd5:8295:5339::43 fa:16:3e:54:c6:8e \ host-fd5b-1fd5-8295-5339--43 Once dnsmasq updates the leases database, rewrites the leases file with the new IPv6 address (including the IAID) and the server DUID (if not present). Change-Id: Ib1b2f284ab81f1c4af7b08b5257b45a3f6e79c3e Closes-Bug: #1722126 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1722126 Title: Incorrect IPv6 lease entries cause DHCPNAKs from Dnsmasq in dual stack DHCPv6 stateful network configuration Status in neutron: Fix Released Bug description: In a dual stack network with DHCPv6 stateful network configuration, Neutron DHCP Agent uses the IPv4 lease entry format to write IPv6 lease entries in the fake lease file used to bootstrap Dnsmasq after agent is restarted or migrated from one node to the other. As a result, the lease file gets corrupted and overwritten by Dnsmasq after encountering the invalid IPv6 lease entries and this causes a DHCPNAK when IPv4 clients try to renew their leases with the Dnsmasq process. From the Dnsmasq mailing list, a lease entry for DHCPv4 consists of these fields seperated by spaces: - The expiration time (seconds since unix epoch) or duration (if dnsmasq is compiled with HAVE_BROKEN_RTC) of the lease. 0 means infinite. - The link address, in format XX-YY:YY:YY[...], where XX is the ARP hardware type. "XX-" may be omitted for Ethernet. - The IPv4 address - The hostname (sent by the client or assigned by dnsmasq) or '*' for none. - The client identifier (colon-separated hex bytes) or '*' for none. While a DHCPv6 lease entry has these fields: - The expiration time or duration - The IAID as a Big Endian decimal number, prefixed by T for IA_TAs (temporary addresses). - The IPv6 address - The hostname or '*' - The client DUID (colon-separated hex bytes) or '*' if unknown.[1] For DHCPv6, there must also be exactly one special entry indicating the DUID of the server. This line contains two fields: - The string "duid". - The DUID of the server. See http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q2/010595.html for more info about the discussion. Symptoms: --------- Currently, the _output_init_lease_file function in neutron/agent/linux/dhcp.py writes lease entries for both IPv4 and IPv6 like this: 1506979604 fa:16:3e:07:b4:26 10.0.1.128 * * 1506979604 fa:16:3e:07:b4:26 [2404:130:21:4000::24c] * * 1506979604 fa:16:3e:20:20:a9 10.0.1.83 * * 1506979604 fa:16:3e:26:cf:8a 10.0.1.135 * * To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1722126/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

