diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 5703f8cc0..14ac7c13d 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1080,10 +1080,11 @@ ofputil_format_version_bitmap_names(struct ds *msg, uint32_t bitmap) static bool ofputil_decode_hello_bitmap(const struct ofp_hello_elem_header *oheh, - uint32_t *allowed_versions) + uint32_t *allowed_versionsp) { uint16_t bitmap_len = ntohs(oheh->length) - sizeof *oheh; const ovs_be32 *bitmap = (const ovs_be32 *) (oheh + 1); + uint32_t allowed_versions; if (!bitmap_len || bitmap_len % sizeof *bitmap) { return false; @@ -1094,21 +1095,22 @@ ofputil_decode_hello_bitmap(const struct ofp_hello_elem_header *oheh, * should have no effect on session negotiation until Open vSwtich supports * wire-protocol versions greater than 31. */ - *allowed_versions = ntohl(bitmap[0]); + allowed_versions = ntohl(bitmap[0]); - if (*allowed_versions & 1) { + if (allowed_versions & 1) { /* There's no OpenFlow version 0. */ VLOG_WARN_RL(&bad_ofmsg_rl, "peer claims to support invalid OpenFlow " "version 0x00"); - *allowed_versions &= ~1u; + allowed_versions &= ~1u; } - if (!*allowed_versions) { + if (!allowed_versions) { VLOG_WARN_RL(&bad_ofmsg_rl, "peer does not support any OpenFlow " "version (between 0x01 and 0x1f)"); return false; } + *allowed_versionsp = allowed_versions; return true; }