From: Simon Horman Date: Wed, 1 Aug 2012 07:01:51 +0000 (+0900) Subject: ofp-print: Use the prevailing protocol to call ofputil_decode_flow_mod() X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=981c5fdde344eff52a546002c488230fd17edba0;p=openvswitch ofp-print: Use the prevailing protocol to call ofputil_decode_flow_mod() 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 Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index e8a928e5..b4b8bb6a 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -685,9 +685,13 @@ 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; + + protocol = ofputil_protocol_from_ofp_version(oh->version); + protocol = ofputil_protocol_set_tid(protocol, true); 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);