ovs-dpctl: In "dump-flows", only print flows that can be retrieved.
authorBen Pfaff <blp@nicira.com>
Tue, 13 Apr 2010 23:48:10 +0000 (16:48 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Apr 2010 23:51:13 +0000 (16:51 -0700)
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).

utilities/ovs-dpctl.c

index eb78a573beb333f98a0e2ce3388d74de9e90ffaf..ecfb3069ade397fe657900e2f0079738f685afcb 100644 (file)
@@ -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);