When a logical switch has 2 FWGs and each FWG has 3 ports,
Logical-Flow only has one fwg_group() action.
Submitted-at: northd: Fix issues for Forwarding_Group by ZhangQiang3 * Pull 
Request #250 * ovn-org/ovn (github.com)<https://github.com/ovn-org/ovn/pull/250>

>From 02186da234426bc361615eb6b5142c76f296202f Mon Sep 17 00:00:00 2001
From: zhangqiang45 [email protected]<mailto:[email protected]>
Date: Mon, 8 Jul 2024 14:25:04 +0800
Subject: [PATCH ovn] northd: Fix issues for Forwarding_Group     The use of
variables from the outer loop in the inner loop causes the outer loop to
terminate prematurely.     eg. LVS are three fwgs,
fwg1(p1,p2,p3,p4),fwg2(p11,p22),fwg3(p31,p32),only fwg1 in logical_flows

---
northd/northd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/northd/northd.c b/northd/northd.c
index 6898daa00..21ab0bb91 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -7929,6 +7929,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct 
lflow_table *lflows,
             continue;
         }

+        ds_clear(&match);
+        ds_clear(&actions);
+
         /* ARP responder for the forwarding group's virtual IP */
         ds_put_format(&match, "arp.tpa == %s && arp.op == 1",
                       fwd_group->vip);
@@ -7959,9 +7962,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct 
lflow_table *lflows,
             ds_put_cstr(&group_ports, "liveness=\"true\",");
         }
         ds_put_cstr(&group_ports, "childports=");
-        for (i = 0; i < (fwd_group->n_child_port - 1); ++i) {
+        for (int j = 0; j < (fwd_group->n_child_port - 1); ++j) {
             ds_put_format(&group_ports, "\"%s\",",
-                         fwd_group->child_port[i]);
+                         fwd_group->child_port[j]);
         }
         ds_put_format(&group_ports, "\"%s\"",
                       fwd_group->child_port[fwd_group->n_child_port - 1]);
--
2.39.3

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

Reply via email to