From: Simon Horman Date: Thu, 4 Oct 2012 02:41:16 +0000 (+0900) Subject: ofp-util: Set Packet In Format: Use prevailing OpenFlow version X-Git-Tag: v1.9.0~155 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=3f4a1939ad520d55324471b492231976789b7a74;p=cascardo%2Fovs.git ofp-util: Set Packet In Format: Use prevailing OpenFlow version Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 5e0839a35..00dfea3ed 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1084,12 +1084,13 @@ ofputil_nx_flow_format_to_string(enum nx_flow_format flow_format) } struct ofpbuf * -ofputil_make_set_packet_in_format(enum nx_packet_in_format packet_in_format) +ofputil_make_set_packet_in_format(enum ofp_version ofp_version, + enum nx_packet_in_format packet_in_format) { struct nx_set_packet_in_format *spif; struct ofpbuf *msg; - msg = ofpraw_alloc(OFPRAW_NXT_SET_PACKET_IN_FORMAT, OFP10_VERSION, 0); + msg = ofpraw_alloc(OFPRAW_NXT_SET_PACKET_IN_FORMAT, ofp_version, 0); spif = ofpbuf_put_zeros(msg, sizeof *spif); spif->format = htonl(packet_in_format); diff --git a/lib/ofp-util.h b/lib/ofp-util.h index 8ef220689..c5812c678 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -131,7 +131,8 @@ ovs_be16 ofputil_dl_type_from_openflow(ovs_be16 ofp_dl_type); bool ofputil_packet_in_format_is_valid(enum nx_packet_in_format); int ofputil_packet_in_format_from_string(const char *); const char *ofputil_packet_in_format_to_string(enum nx_packet_in_format); -struct ofpbuf *ofputil_make_set_packet_in_format(enum nx_packet_in_format); +struct ofpbuf *ofputil_make_set_packet_in_format(enum ofp_version, + enum nx_packet_in_format); /* NXT_FLOW_MOD_TABLE_ID extension. */ struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id); diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index dea88787e..39aed8617 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1085,7 +1085,10 @@ static void set_packet_in_format(struct vconn *vconn, enum nx_packet_in_format packet_in_format) { - struct ofpbuf *spif = ofputil_make_set_packet_in_format(packet_in_format); + struct ofpbuf *spif; + + spif = ofputil_make_set_packet_in_format(vconn_get_version(vconn), + packet_in_format); transact_noreply(vconn, spif); VLOG_DBG("%s: using user-specified packet in format %s", vconn_get_name(vconn), @@ -1386,7 +1389,8 @@ ofctl_monitor(int argc, char *argv[]) } else { struct ofpbuf *spif, *reply; - spif = ofputil_make_set_packet_in_format(NXPIF_NXM); + spif = ofputil_make_set_packet_in_format(vconn_get_version(vconn), + NXPIF_NXM); run(vconn_transact_noreply(vconn, spif, &reply), "talking to %s", vconn_get_name(vconn)); if (reply) {