2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

ofproto: As of Open Flow 1.1 switch_features has no capabilities field

In Open Flow 1.0 switch_features has a capabilities field.
However, in Open Flow 1.1, 1.2 and 1.3 this field is reserved.
Thus it should not be read on decode and it seems most appropriate
to set as zero on encode.

This patch takes the approach of setting the features field to
all available features for Open Flow 1.1+. I am unsure if it would
be sufficient to just set it to zero.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Simon Horman
2012-07-30 11:03:00 +09:00
committed by Ben Pfaff
parent 2e3fa633aa
commit 210d8d9cc1
3 changed files with 23 additions and 7 deletions

View File

@@ -2418,7 +2418,16 @@ ofputil_decode_switch_features(const struct ofp_header *oh,
if (osf->capabilities & htonl(OFPC11_GROUP_STATS)) {
features->capabilities |= OFPUTIL_C_GROUP_STATS;
}
features->actions = decode_action_bits(osf->actions, of11_action_bits);
switch ((enum ofp_version)oh->version) {
case OFP11_VERSION:
case OFP12_VERSION:
features->actions = decode_action_bits(htonl(UINT32_MAX),
of11_action_bits);
break;
case OFP10_VERSION:
default:
NOT_REACHED();
}
} else {
return OFPERR_OFPBRC_BAD_VERSION;
}
@@ -2517,7 +2526,6 @@ ofputil_encode_switch_features(const struct ofputil_switch_features *features,
if (features->capabilities & OFPUTIL_C_GROUP_STATS) {
osf->capabilities |= htonl(OFPC11_GROUP_STATS);
}
osf->actions = encode_action_bits(features->actions, of11_action_bits);
break;
default:
NOT_REACHED();