diff mbox series

[ovs-dev,4/5] ofctrl: Fix removing wrong conjunction during the duplicate check.

Message ID 20260313163739.1410812-5-i.maximets@ovn.org
State Accepted
Headers show
Series ofctrl: Fix inefficient merge of conjunctive flows. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ilya Maximets March 13, 2026, 4:37 p.m. UTC
The ofpbuf_pull() removes the data from the head, not the tail.  So it
removes the first added conjunction instead of the last.

This is not causing any issues with the current code as the way
expression normalization works we can't have more than one conjunction
in the vector.  But still worth fixing for correctness, in case the
expression normalization logic ever changes.

Fixes: 9a4035402982 ("ofctrl: Optimize and specialize the ofctrl_add_or_append_flow function.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 controller/ofctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/controller/ofctrl.c b/controller/ofctrl.c
index 4d53dd049..552a35ccf 100644
--- a/controller/ofctrl.c
+++ b/controller/ofctrl.c
@@ -1354,7 +1354,7 @@  create_conjunction_actions(const struct vector *conjunctions,
         conj->n_clauses = cls->n_clauses;
 
         if (existing && ofpact_ref_find(existing, &conj->ofpact)) {
-            ofpbuf_pull(ofpbuf, sizeof *conj);
+            ofpbuf->size -= sizeof *conj;
         }
     }