Pass a protocol based on the prevailing protocol to ofputil_decode_flow_mod()
Note that ofputil_protocol_from_ofp_version() needs to be made Open Flow 1.1 aware. Signed-off-by: Simon Horman <ho...@verge.net.au> --- v7 * Manual Rebase v6 * No change v5 * No change v4 * No change v3 * No change v2 * Actually pass calculated protocol to ofputil_decode_flow_mod() Conflicts: lib/ofp-print.c --- lib/ofp-print.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 7a18830..dcbd2c5 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -675,9 +675,19 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, int verbosity) bool need_priority; enum ofperr error; enum ofpraw raw; + enum ofputil_protocol protocol; + + switch(oh->version) { + case OFP10_VERSION: + protocol = OFPUTIL_P_OF10_TID; + break; + default: + protocol = ofputil_protocol_from_ofp_version(oh->version); + break; + } ofpbuf_init(&ofpacts, 64); - error = ofputil_decode_flow_mod(&fm, oh, OFPUTIL_P_OF10_TID, &ofpacts); + error = ofputil_decode_flow_mod(&fm, oh, protocol, &ofpacts); if (error) { ofpbuf_uninit(&ofpacts); ofp_print_error(s, error); -- 1.7.10.2.484.gcd07cc5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev