summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2017-04-17 14:11:29 -0700
committerBen Pfaff <blp@ovn.org>2017-04-24 09:53:59 -0700
commite19a67692d17301c6ebcd5d634f03a9a46da0a5d (patch)
tree9b52d1d60b041f50134da2f5569a0395ca7fbb19 /ofproto
parent391097b6106ebdb4466f471d38a04520ee1ab348 (diff)
downloadopenvswitch-e19a67692d17301c6ebcd5d634f03a9a46da0a5d.tar.gz
connmgr: Fix internal packet-in reason code mask.
Starting from OpenFlow 1.4+, OFPR_ACTION is split into four more descriptive reasons, OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, and OFPR_PACKET_OUT. OVS maintains the new reason code internally, and it currently supports the first three reason code. If the version of an established OpenFlow connection is less than 1.4, OVS converts the internal reason code back to OFPR_ACTION to be backward compatible. However, the internal packet-in reason code mask is not properly maintained for the older OpenFlow version that may emit the packet-in messages wth the new reason code. It is because OVS does not enable the new reason code internally in the reason code mask for older OpenFlow version. This commit tries to address the aforementioned issue. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/connmgr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 854868e7b..2b0b78f61 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -1092,6 +1092,16 @@ ofconn_set_async_config(struct ofconn *ofconn,
ofconn->async_cfg = xmalloc(sizeof *ofconn->async_cfg);
}
*ofconn->async_cfg = *ac;
+
+ if (ofputil_protocol_to_ofp_version(ofconn_get_protocol(ofconn))
+ < OFP14_VERSION) {
+ if (ofconn->async_cfg->master[OAM_PACKET_IN] & (1u << OFPR_ACTION)) {
+ ofconn->async_cfg->master[OAM_PACKET_IN] |= OFPR14_ACTION_BITS;
+ }
+ if (ofconn->async_cfg->slave[OAM_PACKET_IN] & (1u << OFPR_ACTION)) {
+ ofconn->async_cfg->slave[OAM_PACKET_IN] |= OFPR14_ACTION_BITS;
+ }
+ }
}
struct ofputil_async_cfg