[ovs-dev] [ofp-util logging 1/3] ofp-util: Improve log message for bad OpenFlow action length.
Justin Pettit
jpettit at nicira.com
Fri Dec 24 00:20:38 UTC 2010
Looks good.
--Justin
On Dec 23, 2010, at 10:41 AM, Ben Pfaff wrote:
> First, this is an important message since it indicates a bug in the
> controller, so log it at warning level instead of debug level--we want to
> know about it.
>
> Second, properly byteswap the action type.
>
> Third, use the correct PRIu16 format specified for a uint16_t.
> ---
> lib/ofp-util.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> index 8f28edb..03ddf0e 100644
> --- a/lib/ofp-util.c
> +++ b/lib/ofp-util.c
> @@ -1637,9 +1637,9 @@ check_action_exact_len(const union ofp_action *a, unsigned int len,
> unsigned int required_len)
> {
> if (len != required_len) {
> - VLOG_DBG_RL(&bad_ofmsg_rl,
> - "action %u has invalid length %"PRIu16" (must be %u)\n",
> - a->type, ntohs(a->header.len), required_len);
> + VLOG_WARN_RL(&bad_ofmsg_rl, "action %"PRIu16" has invalid length "
> + "%"PRIu16" (must be %u)\n",
> + ntohs(a->type), ntohs(a->header.len), required_len);
> return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_LEN);
> }
> return 0;
> --
> 1.7.1
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
More information about the dev
mailing list