Skip to content

Commit

Permalink
northd: Fix iteration over vip backends.
Browse files Browse the repository at this point in the history
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: f1119c1 ("northd: Refactor load balancer vip parsing.")
Tested-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>

(cherry-picked from master commit 5c2d311)
  • Loading branch information
igsilya authored and numansiddique committed Dec 7, 2020
1 parent 44c323a commit d8bc037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion northd/ovn-northd.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit d8bc037

Please sign in to comment.