From b89d25e5694bc9bb0a1fbb2a025d18a2a231c633 Mon Sep 17 00:00:00 2001 From: Guoshuai Li Date: Thu, 9 Mar 2017 10:53:37 +0800 Subject: [PATCH] ovn: Modify the DHCPv4 router option to optional Co-authored-by: Dong Jun Signed-off-by: Dong Jun Signed-off-by: Guoshuai Li Acked-by: Numan Siddique Signed-off-by: Ben Pfaff --- NEWS | 2 ++ ovn/northd/ovn-northd.c | 10 +++------- ovn/ovn-nb.xml | 16 ++++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 83a7c97c3cd..e2e456a0538 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ Post-v2.7.0 - The "learn" action now supports a "limit" option (see ovs-ofctl(8)). - New support for multiple VLANs (802.1ad or "QinQ"), including a new "dot1q-tunnel" port VLAN mode. + - OVN: + * Make the DHCPv4 router setting optional. v2.7.0 - 21 Feb 2017 --------------------- diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index cc9b9344627..8c8f16b8f04 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2279,11 +2279,9 @@ build_dhcpv4_action(struct ovn_port *op, ovs_be32 offer_ip, &op->nbsp->dhcpv4_options->options, "server_mac"); const char *lease_time = smap_get( &op->nbsp->dhcpv4_options->options, "lease_time"); - const char *router = smap_get( - &op->nbsp->dhcpv4_options->options, "router"); - if (!(server_ip && server_mac && lease_time && router)) { - /* "server_id", "server_mac", "lease_time" and "router" should be + if (!(server_ip && server_mac && lease_time)) { + /* "server_id", "server_mac" and "lease_time" should be * present in the dhcp_options. */ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "Required DHCPv4 options not defined for lport - %s", @@ -2826,9 +2824,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows) &od->nbs->ports[i]->dhcpv4_options->options, "server_mac"); const char *lease_time = smap_get( &od->nbs->ports[i]->dhcpv4_options->options, "lease_time"); - const char *router = smap_get( - &od->nbs->ports[i]->dhcpv4_options->options, "router"); - if (server_id && server_mac && lease_time && router) { + if (server_id && server_mac && lease_time) { struct ds match = DS_EMPTY_INITIALIZER; const char *actions = has_stateful ? "ct_commit; next;" : "next;"; diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index 88a6082d119..46a25f66b4b 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -1393,14 +1393,6 @@ The Ethernet address for the DHCP server to use. - -

- The IP address of a gateway for the client to use. This should be - in the subnet of the offered IP. The DHCPv4 option code for this - option is 3. -

-
-

@@ -1422,6 +1414,14 @@ DHCPv4 options and their codes.

+ +

+ The IP address of a gateway for the client to use. This should be + in the subnet of the offered IP. The DHCPv4 option code for this + option is 3. +

+
+

The DHCPv4 option code for this option is 1.