[ovs-dev] [PATCH ovn 1/2] northd-ddlog: Fix lb_force_snat_ip router option.

numans at ovn.org numans at ovn.org
Wed Mar 3 18:02:22 UTC 2021


From: Numan Siddique <numans at ovn.org>

There were few typos because of which lflows related to
router option lb_force_snat_ip were not generated correctly.

This patch fixes it.

Fixes: 0e77b3bcbfe("ovn-northd-ddlog: New implementation of ovn-northd based on ddlog.")
CC: Ben Pfaff <blp at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>
---
 northd/ovn_northd.dl | 4 ++--
 tests/ovn-northd.at  | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl
index 4482cffc0..8fc24dfcb 100644
--- a/northd/ovn_northd.dl
+++ b/northd/ovn_northd.dl
@@ -5488,7 +5488,7 @@ Flow(.logical_datapath = logical_router,
      .stage = router_stage(OUT, SNAT),
      .priority = 100,
      .__match = "flags.force_snat_for_${context} == 1 && ${ipX}",
-     .actions = "ct_snat(%{ip});",
+     .actions = "ct_snat(${ip});",
      .external_ids = map_empty()) :-
     LogicalRouterForceSnatFlows(.logical_router = logical_router,
                                 .ips = ips,
@@ -5500,7 +5500,7 @@ Flow(.logical_datapath = logical_router,
  * This only takes effect when the packet has already been
  * load balanced once. */
 for (rp in &RouterPort(.router = &Router{.lr = lr}, .lrp = lrp)) {
-    if (lb_force_snat_router_ip(lrp.options) and rp.peer != PeerNone) {
+    if (lb_force_snat_router_ip(lr.options) and rp.peer != PeerNone) {
         Some{var ipv4} = rp.networks.ipv4_addrs.nth(0) in {
             Flow(.logical_datapath = lr._uuid,
                  .stage = router_stage(OUT, SNAT),
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index f3f88fa12..b9ae63cfa 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -2699,6 +2699,7 @@ wait_row_count nb:Logical_Switch_Port 1 up=false name=lsp1
 
 AT_CLEANUP
 
+OVN_FOR_EACH_NORTHD([
 AT_SETUP([ovn -- lb_force_snat_ip for Gateway Routers])
 ovn_start
 
@@ -2777,6 +2778,7 @@ AT_CHECK([grep "lr_out_snat" lr0flows | grep force_snat_for_lb | sort], [0], [dn
 ])
 
 AT_CLEANUP
+])
 
 AT_SETUP([ovn -- HA chassis group cleanup for external port ])
 ovn_start
-- 
2.29.2



More information about the dev mailing list