]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Enable specific extra_dhcp_opt to be left blank
authorDavid Edery <david.edery@alcatel-lucent.com>
Mon, 12 Oct 2015 08:11:50 +0000 (11:11 +0300)
committerDavid Edery <david.edery@alcatel-lucent.com>
Thu, 15 Oct 2015 11:16:17 +0000 (14:16 +0300)
commit3837427189a54e6c052d773d629bac53d95702dc
tree62bac7d9f5773342df9ed5df125bc2f42f7d766c
parentf3ccc38c88c0c479046b155eefbff51a22d59e0a
Enable specific extra_dhcp_opt to be left blank

In some cases there is a need for a blank value of the "router" extra
dhcp option. This fix addresses this issue by introducing a simple
mechanism in the code that allows specific extra dhcp options to be left
blank by applying a different opt_value validation of the data received
from the REST call and different validation on the value that will be
written to the DB.

This fix also takes into consideration bug #1257467 which claims that
in case of a blank "server-ip-address" option a segmentation fault
occurs in dnsmasq. I did not check this claim with a newer dnsmasq
version since it seemed logical that the list of potentially blank
options should be limited to options that are known to work well when
blank and have functional justification for being blank (e.g. "router")

APIImpact
"router" and "classless-static-route" extra dhcp options can be blank
(e.g. opt-name="router", opt-value="")

DocImpact
During port creation/update, Specific extra-dhcp-options can be left
blank ("router" and/or "classless-static-route"). This causes dnsmasq
to have an empty option in the "opts" file related to the network to
which the port is related.
For example:
tag:tag0,option:classless-static-route,
tag:tag0,option:router,

Closes-Bug: #1437695
Related-Bug: #1257467

Change-Id: I0ac76e132c4bd86da39863674d4cf8a22dad7034
neutron/db/extradhcpopt_db.py
neutron/extensions/extra_dhcp_opt.py
neutron/tests/unit/extensions/test_extra_dhcp_opt.py