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).
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);