From bc0f51765d2741d122f07252b6b37c985c7e9325 Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Tue, 25 Jul 2017 14:26:22 -0700 Subject: flow: Refactor flow_compose() API. Currently, flow_compose_size() is only supposed to be called after flow_compose(). I find this API to be unintuitive. Change flow_compose() API to take the 'size' argument, and returns 'true' if the packet can be created, 'false' otherwise. This change also improves error detection and reporting when 'size' is unreasonably small. Signed-off-by: Andy Zhou Acked-by: Ilya Maximets --- ofproto/ofproto-dpif-trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ofproto/ofproto-dpif-trace.c') diff --git a/ofproto/ofproto-dpif-trace.c b/ofproto/ofproto-dpif-trace.c index b3f3cbc6a..38d11002f 100644 --- a/ofproto/ofproto-dpif-trace.c +++ b/ofproto/ofproto-dpif-trace.c @@ -376,7 +376,7 @@ parse_flow_and_packet(int argc, const char *argv[], /* Generate a packet, if requested. */ if (packet) { if (!dp_packet_size(packet)) { - flow_compose(packet, flow); + flow_compose(packet, flow, 0); } else { /* Use the metadata from the flow and the packet argument * to reconstruct the flow. */ -- cgit v1.2.1