From: Ben Pfaff Date: Thu, 23 Dec 2010 18:36:02 +0000 (-0800) Subject: ofp-util: Improve log message for bad OpenFlow action length. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35c4693ab8d10c1271484f39a72751f613cf8de1;p=openvswitch ofp-util: Improve log message for bad OpenFlow action length. 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. --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 8f28edbd..03ddf0e0 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;