diff --git a/AUTHORS.rst b/AUTHORS.rst index 65c8761f4a..351523fd15 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -448,6 +448,7 @@ xushengping shengping.xu@huawei.com yinpeijun yinpeijun@huawei.com zangchuanqiang zangchuanqiang@huawei.com zhang yanxian zhangyanxian@pmlabs.com.cn +zhangqiang45 zhangqiang45@lenovo.com zhaojingjing zhao.jingjing1@zte.com.cn zhongbaisong zhongbaisong@huawei.com zhaozhanxu zhaozhanxu@163.com diff --git a/northd/northd.c b/northd/northd.c index 2873a9bc48..95e26c3978 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -8930,13 +8930,16 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct hmap *lflows) struct ds actions = DS_EMPTY_INITIALIZER; struct ds group_ports = DS_EMPTY_INITIALIZER; - for (int i = 0; i < od->nbs->n_forwarding_groups; ++i) { + for (size_t i = 0; i < od->nbs->n_forwarding_groups; ++i) { const struct nbrec_forwarding_group *fwd_group = NULL; fwd_group = od->nbs->forwarding_groups[i]; if (!fwd_group->n_child_port) { 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); @@ -8967,9 +8970,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct hmap *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 (size_t 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]); diff --git a/tests/ovn.at b/tests/ovn.at index 52dc19faa5..be274d1ec3 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -27421,7 +27421,14 @@ check ovs-vsctl add-port br-int vif3 -- set Interface vif3 external-ids:iface-id # Add a forwarding group on ls2 with lsp21 and lsp22 as child ports # virtual IP - 172.16.1.11, virtual MAC - 00:11:de:ad:be:ef check ovn-nbctl --wait=hv fwd-group-add fwd_grp1 ls2 172.16.1.11 00:11:de:ad:be:ef lsp21 lsp22 +check ovn-nbctl --wait=hv fwd-group-add fwd_grp2 ls2 172.16.2.11 00:22:de:ad:be:ef lsp21 lsp22 +# Check logical flow +AT_CAPTURE_FILE([sbflows]) +ovn-sbctl dump-flows > sbflows +AT_CHECK([grep ls_in_l2_lkup sbflows | grep fwd_group | wc -l], [0], [2 +]) +check ovn-nbctl --wait=hv fwd-group-del fwd_grp2 # Check logical flow AT_CAPTURE_FILE([sbflows]) ovn-sbctl dump-flows > sbflows