Previously even when OF1.4 is used between the controller and the switch, packet-in messages has OF1.3 as wire protocol version.
Signed-off-by: Shu Shen <shu.s...@radisys.com> --- lib/ofp-msgs.h | 2 +- lib/ofp-util.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h index fc69586..ad6dc6f 100644 --- a/lib/ofp-msgs.h +++ b/lib/ofp-msgs.h @@ -148,7 +148,7 @@ enum ofpraw { OFPRAW_OFPT11_PACKET_IN, /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */ OFPRAW_OFPT12_PACKET_IN, - /* OFPT 1.3 (10): struct ofp13_packet_in, uint8_t[]. */ + /* OFPT 1.3+ (10): struct ofp13_packet_in, uint8_t[]. */ OFPRAW_OFPT13_PACKET_IN, /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */ OFPRAW_NXT_PACKET_IN, diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 94047fa..86cf8a1 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -3527,7 +3527,7 @@ ofputil_encode_ofp12_packet_in(const struct ofputil_packet_in *pin, packet_in_size = sizeof (struct ofp12_packet_in); } else { packet_in_raw = OFPRAW_OFPT13_PACKET_IN; - packet_in_version = OFP13_VERSION; + packet_in_version = ofputil_protocol_to_ofp_version(protocol); packet_in_size = sizeof (struct ofp13_packet_in); } @@ -3547,7 +3547,7 @@ ofputil_encode_ofp12_packet_in(const struct ofputil_packet_in *pin, opi->pi.total_len = htons(pin->total_len); opi->pi.reason = pin->reason; opi->pi.table_id = pin->table_id; - if (protocol == OFPUTIL_P_OF13_OXM) { + if (protocol & OFPUTIL_P_OF13_UP) { opi->cookie = pin->cookie; } -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev