diff mbox

[ovs-dev,v4] ovn: Modify the DHCPv4 router option to optional

Message ID 20170307055008.27668-1-ligs@dtdream.com
State Superseded
Headers show

Commit Message

Guoshuai Li March 7, 2017, 5:50 a.m. UTC
Co-authored-by: Dong Jun <dongj@dtdream.com>
Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
---
 NEWS                    |  2 ++
 ovn/northd/ovn-northd.c | 10 +++-------
 ovn/ovn-nb.xml          | 16 ++++++++--------
 3 files changed, 13 insertions(+), 15 deletions(-)

Comments

Russell Bryant March 7, 2017, 1:28 p.m. UTC | #1
On Tue, Mar 7, 2017 at 12:50 AM, Guoshuai Li <ligs@dtdream.com> wrote:

> Co-authored-by: Dong Jun <dongj@dtdream.com>
>

Since Dong Jun is a co-author of the patch, we need a "Signed-off-by"
header for Dong Jun, as well.  Can you please add it?

Thanks for the patch!


> Signed-off-by: Guoshuai Li <ligs@dtdream.com>
> Acked-by: Numan Siddique <nusiddiq@redhat.com>
>
diff mbox

Patch

diff --git a/NEWS b/NEWS
index ce9fe88..853b5ef 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@  Post-v2.7.0
        `egress_pkt_mark` OVSDB option.
    - EMC insertion probability is reduced to 1% and is configurable via
      the new 'other_config:emc-insert-inv-prob' option.
+   - OVN:
+     * Modify the DHCPv4 router option to optional in northbound databases.
 
 v2.7.0 - xx xxx xxxx
 ---------------------
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 03dc850..d844a60 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2191,11 +2191,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",
@@ -2738,9 +2736,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 c5ebbea..a17d876 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -1365,14 +1365,6 @@ 
           The Ethernet address for the DHCP server to use.
         </column>
 
-        <column name="options" key="router">
-          <p>
-            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.
-          </p>
-        </column>
-
         <column name="options" key="lease_time"
                 type='{"type": "integer", "minInteger": 0, "maxInteger": 4294967295}'>
           <p>
@@ -1394,6 +1386,14 @@ 
           DHCPv4 options and their codes.
         </p>
 
+        <column name="options" key="router">
+          <p>
+            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.
+          </p>
+        </column>
+
         <column name="options" key="netmask">
           <p>
             The DHCPv4 option code for this option is 1.