[ovs-dev] [ofp-util logging 1/3] ofp-util: Improve log message for bad OpenFlow action length.

Romain Lenglet romain at midokura.jp
Thu Dec 23 23:23:19 UTC 2010


Hi Ben,

This patch is very useful!
We've been bitten by such a bug just this week, and had to do this exact
same patch for debugging.
However, the bug in our controller wasn't that we sent actions with the
wrong length, it was that we sent vendor actions with the wrong subtype (and
this other subtype had a different action length). We have added custom
vendor actions to OVS, and our subtypes have to change every time you add
one upstream, so we're regularly bitten by such bugs.

For Christmas, I'm wishing for a command line tool that prints out a mapping
between vendor action names (as printed by ofp-print, etc.) and subtypes.
That would be extremely helpful for us, although I'm not sure if that would
be helpful for anybody else. Is there any interest in such a tool?

Sincerely,
--
Romain Lenglet

On Fri, Dec 24, 2010 at 3:41 AM, Ben Pfaff <blp at nicira.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20101224/1eefbbac/attachment-0003.html>


More information about the dev mailing list