[ovs-dev] [PATCH] ofproto-dpif-xlate: Change assertion to log message.

Ben Pfaff blp at ovn.org
Thu Dec 7 21:01:58 UTC 2017


Until now, compose_output_action__() has asserted that a packet output to
a patch port is not to be truncated.  This commit changes this to an error
that will be included in trace output, for two reasons.  First, this sounds
like only a minor problem to me which doesn't warrant killing the process.
Second, it will be easier to track down the actual problem (if any) if we
can get a trace instead of a segfault.

Reported-by: Kevin Lin <kevin at kelda.io>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-December/045832.html
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 ofproto/ofproto-dpif-xlate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index fcced344ed8a..60eaf18038ca 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -3701,7 +3701,9 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port,
     }
 
     if (xport->peer) {
-       ovs_assert(!truncate);
+       if (truncate) {
+           xlate_report_error(ctx, "Cannot truncate output to patch port");
+       }
        patch_port_output(ctx, xport, xport->peer);
        return;
     }
-- 
2.10.2



More information about the dev mailing list