[ovs-dev] [PATCH ovn] northd: Fix iteration over vip backends.

Ilya Maximets i.maximets at ovn.org
Fri Dec 4 18:50:30 UTC 2020


During refactoring, direct access such as 'lb->vips[i].backends[j].op'
was simplified by the presence of the 'backend_nb' pointer. But instead
of the inner one, the index of the outer loop was used.  This forces
northd to only use one backend per vip, and can also lead to invalid
memory accesses.

This change fixes system test:
  24. ovn -- Load balancer health checks

Fixes: f1119c125765 ("northd: Refactor load balancer vip parsing.")
Tested-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 northd/ovn-northd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index c0eab429d..403342b0d 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -6949,7 +6949,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
 
             for (size_t j = 0; j < lb_vip_nb->n_backends; j++) {
                 struct ovn_northd_lb_backend *backend_nb =
-                    &lb_vip_nb->backends_nb[i];
+                    &lb_vip_nb->backends_nb[j];
                 if (!backend_nb->op || !backend_nb->svc_mon_src_ip) {
                     continue;
                 }
-- 
2.25.4



More information about the dev mailing list