[Dnsmasq-discuss] hostsfile entries order

Ihar Hrachyshka ihrachys at redhat.com
Thu Jun 18 14:12:25 BST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

in openstack neutron, we experience the following bug [1]:

For a port, if we configure both a stateful (dhcp4 or dhcpv6-stateful)
address AND a dhcpv6-stateless address with an extra dhcp option
assigned, then neutron dhcp agent fails to provide stateful addresses
to a client.

Neutron dhcp agent assign extra dhcp options to ports by setting
set:<tag> in hostsfile [2]. In case there is no address assigned to
the port (=dhcpv6-stateless), the host entry is of the following form
[3]: "<hwaddr>,set:<port-id>" Now, if that entry goes in the hosts
file AFTER other entries for the same hwaddr, then it breaks other,
stateful addresses' assignment.

There is a fix in the fly that makes sure bare (stateless 'set:')
entries go at the very start of the hosts file [4].

After the patch is applied, all addresses are assigned properly.

I have several questions:
- - are we doing it right? if not, what would you suggest?
- - why does dnsmasq even match starting from the end of the hosts file?
is it documented behavior? can we rely on it?
- - does dnsmasq quickly bail out on the very first match in the hosts fil
e?

[1]: https://bugs.launchpad.net/neutron/+bug/1466144
[2]:
http://git.openstack.org/cgit/openstack/neutron/tree/neutron/agent/linux
/dhcp.py?id=2015.1.0#n509
[3]:
http://git.openstack.org/cgit/openstack/neutron/tree/neutron/agent/linux
/dhcp.py?id=2015.1.0#n491
[4]: https://review.openstack.org/185066

Thanks
Ihar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVgsO1AAoJEC5aWaUY1u57sfEH/RfV273AFbAlaCRYLqMB5Tzq
S5B9kBi5NjiVTPslsV5/gkDYn1RbW3rb66tGQ2t58BedKRTNkaTSfIVKRvSXFgmU
x6egfehd7I0qtGIp/orVd4DRRDZVknEFwuSn1CyaRJKjVwDCUXvfhuEZJUdyNGBw
ml//skcKBRK5BlKNht7jHCbjsX1LHI7j3Bj7YU0mjiA8g5WDgv1b3PoeB1UV8FmQ
LfMjydOW/oXqzBV3XKpIapocscbe2E4A29ZI5vT4JTosYeJC6ivU/xPT2o9ElanV
LIsSGi5ygqpavX1z+WbFhbNuL0shgoghJTEwHZEn8c34kStFrs+MQmTHW/mZZA4=
=pFy7
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list