2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 15:25:22 +00:00

ofp-actions: Add hex dump of bad actions to log message on error.

This should make debugging easier in such cases.

Bug #12460.
Reported-by: Natasha Gude <natasha@nicira.com>
Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2012-07-09 14:21:00 -07:00
parent 5cb2356b59
commit 0c449c5683

View File

@@ -450,8 +450,15 @@ ofpacts_from_openflow10(const union ofp_action *in, size_t n_in,
}
}
if (left) {
VLOG_WARN_RL(&rl, "bad action format at offset %zu",
(n_in - left) * sizeof *a);
if (!VLOG_DROP_WARN(&rl)) {
struct ds s;
ds_init(&s);
ds_put_hex_dump(&s, in, n_in * sizeof *a, 0, false);
VLOG_WARN("bad action format at offset %#x:\n%s",
(n_in - left) * sizeof *a, ds_cstr(&s));
ds_destroy(&s);
}
return OFPERR_OFPBAC_BAD_LEN;
}