Co-authored-by: Dong Jun <[email protected]>
Signed-off-by: Guoshuai Li <[email protected]>
---
 NEWS                    |  2 ++
 ovn/northd/ovn-northd.c | 10 +++-------
 ovn/ovn-nb.xml          |  3 ++-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index ce9fe88..1698d39 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..9b01668 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -1369,7 +1369,8 @@
           <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.
+            option is 3. This is optional and when not specified, option 3 is
+            not present in DHCPv4 response.
           </p>
         </column>
 
-- 
2.10.1.windows.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to