diff mbox

[ovs-dev] ovn: Modify the DHCP router option to optional

Message ID 20170306065520.13016-1-ligs@dtdream.com
State Changes Requested
Headers show

Commit Message

Guoshuai Li March 6, 2017, 6:55 a.m. UTC
Co-authored-by: Dong Jun <dongj@dtdream.com>
Signed-off-by: Guoshuai Li <ligs@dtdream.com>
---
 ovn/northd/ovn-northd.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Ben Pfaff March 6, 2017, 4:13 p.m. UTC | #1
On Mon, Mar 06, 2017 at 02:55:20PM +0800, Guoshuai Li wrote:
> Co-authored-by: Dong Jun <dongj@dtdream.com>
> Signed-off-by: Guoshuai Li <ligs@dtdream.com>

Please update the documentation as well, and add an item to NEWS
mentioning the change.

Thanks,

Ben.
diff mbox

Patch

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;";