[OVN] extra_dhcp_opts does not validate any options

Bug #1874282 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

The OVN driver supports the extra_dhcp_opts extension, however, it does not validate any options passed to it leading to a lot of confusion. The user can input any value and OVN will accept it via the API (retuning 200) but, internally it will just ignore that option if not supported.

E.g:

(overcloud) [stack@undercloud-0 ~]$ neutron port-update --extra-dhcp-opt opt_name='interface-mtu',opt_value='1200' test_port
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Updated port: test_port
(overcloud) [stack@undercloud-0 ~]$ openstack port show test_port | grep -i dhcp
| extra_dhcp_opts | ip_version='4', opt_name='interface-mtu', opt_value='1200'

()[root@controller-2 /]# ovn-nbctl list dhcp_options a825bbdb-3de2-4cd2-aa75-11951894c087
_uuid : a825bbdb-3de2-4cd2-aa75-11951894c087
cidr : "192.168.30.0/24"
external_ids : {"neutron:revision_number"="0", subnet_id="c35226d1-0984-4887-ad38-750c04fba350"}
options : {classless_static_route="{169.254.169.254/32,192.168.30.2, 0.0.0.0/0,192.168.30.1}", dns_server="{172.16.0.1, 10.0.0.1}", lease_time="43200", mtu="1442", router="192.168.30.1", server_id="192.168.30.1", server_mac="fa:16:3e:95:ec:6f"}

Changed in neutron:
importance: Undecided → High
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
status: New → Confirmed
tags: added: ovn
Changed in neutron:
importance: High → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/722025

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/722025
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f6010f60429347485464107b3a838065f2f7ff7d
Submitter: Zuul
Branch: master

commit f6010f60429347485464107b3a838065f2f7ff7d
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Apr 22 15:59:33 2020 +0100

    [OVN] Enhance port's extra DHCP options support

    Prior to this patch OVN did not validate any extra DHCP option passed
    to the port leading to confusion because the user of the API could just
    input any value and OVN would accept it (returning 200) but ignoring the
    option internally.

    This patch now adds such validations on port creation and update.

    This patch also sync with the latest supported DHCP options from OVN and
    create a map between the different names and option codes to their OVN
    counterpart.

    Closes-bug: #1874282
    Change-Id: I99799e54e941cdd8da2614feecad1ef6299703fc
    Signed-off-by: Lucas Alvares Gomes <email address hidden>

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/733122

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/733122
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=32667390c71d74af54ff44347968413b930f97d8
Submitter: Zuul
Branch: stable/ussuri

commit 32667390c71d74af54ff44347968413b930f97d8
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Apr 22 15:59:33 2020 +0100

    [OVN] Enhance port's extra DHCP options support

    Prior to this patch OVN did not validate any extra DHCP option passed
    to the port leading to confusion because the user of the API could just
    input any value and OVN would accept it (returning 200) but ignoring the
    option internally.

    This patch now adds such validations on port creation and update.

    This patch also sync with the latest supported DHCP options from OVN and
    create a map between the different names and option codes to their OVN
    counterpart.

    Closes-bug: #1874282
    Change-Id: I99799e54e941cdd8da2614feecad1ef6299703fc
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit f6010f60429347485464107b3a838065f2f7ff7d)

tags: added: in-stable-ussuri
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.