It might happen that the microflow doesn't have port specified or
the port is part of different datapath. In that case ovn-trace would
print warning and move to later crash on assert. Exit early instead
of crashing on assert.

Signed-off-by: Ales Musil <[email protected]>
---
 utilities/ovn-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c
index e0f1c3ec9..bfc94a73f 100644
--- a/utilities/ovn-trace.c
+++ b/utilities/ovn-trace.c
@@ -3540,7 +3540,7 @@ trace(const char *dp_s, const char *flow_s)
     }
     uint32_t in_key = uflow.regs[MFF_LOG_INPORT - MFF_REG0];
     if (!in_key) {
-        VLOG_WARN("microflow does not specify ingress port");
+        return xstrdup("microflow does not specify ingress port");
     }
     const struct ovntrace_port *inport = ovntrace_port_find_by_key(dp, in_key);
     const char *inport_name = inport ? inport->friendly_name : "(unnamed)";
-- 
2.44.0

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

Reply via email to