From: Ben Pfaff Date: Tue, 13 Apr 2010 23:48:10 +0000 (-0700) Subject: ovs-dpctl: In "dump-flows", only print flows that can be retrieved. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=379c2564b617aa4d36efba0956d92d0d363c6d86;p=openvswitch ovs-dpctl: In "dump-flows", only print flows that can be retrieved. If dpif_flow_get() returns an error then we'd better not try to print the flow (especially not the actions since check_rw_odp_flow() clears the first action to 0xcc). --- diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index eb78a573..ecfb3069 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -473,11 +473,11 @@ do_dump_flows(int argc OVS_UNUSED, char *argv[]) f->actions = actions; f->n_actions = MAX_ACTIONS; - dpif_flow_get(dpif, f); - - ds_clear(&ds); - format_odp_flow(&ds, f); - printf("%s\n", ds_cstr(&ds)); + if (!dpif_flow_get(dpif, f)) { + ds_clear(&ds); + format_odp_flow(&ds, f); + printf("%s\n", ds_cstr(&ds)); + } } ds_destroy(&ds); dpif_close(dpif);