From: Ben Pfaff Date: Fri, 25 Feb 2011 00:58:40 +0000 (-0800) Subject: ofp-print: Don't print priority for flow stats requests. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54ae6fa8f1ae7401652d282609848605fc283104;p=openvswitch ofp-print: Don't print priority for flow stats requests. A flow stats or aggregate stats request does not have a priority, but we were printing one anyway. Reported-by: Justin Pettit --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index bf9bf82e..d4f33daa 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -1074,6 +1074,10 @@ ofp_print_flow_stats_request(struct ds *string, const struct ofp_header *oh) ofp_print_port_name(string, fsr.out_port); } + /* A flow stats request doesn't include a priority, but cls_rule_format() + * will print one unless it is OFP_DEFAULT_PRIORITY. */ + fsr.match.priority = OFP_DEFAULT_PRIORITY; + ds_put_char(string, ' '); cls_rule_format(&fsr.match, string); } diff --git a/tests/ofp-print.at b/tests/ofp-print.at index 5b3c849d..af5249bc 100644 --- a/tests/ofp-print.at +++ b/tests/ofp-print.at @@ -411,7 +411,7 @@ ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 ff 00 ff ff \ "], [0], [dnl -OFPST_FLOW request (xid=0x4): priority=0 +OFPST_FLOW request (xid=0x4): @&t@ ]) AT_CLEANUP @@ -460,7 +460,7 @@ ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 ff 00 ff ff \ "], [0], [dnl -OFPST_AGGREGATE request (xid=0x4): priority=0 +OFPST_AGGREGATE request (xid=0x4): @&t@ ]) AT_CLEANUP @@ -716,7 +716,7 @@ AT_CHECK([ovs-ofctl ofp-print "\ 01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \ 00 00 00 00 00 00 00 00 ff ff 00 00 ff 00 00 00 \ "], [0], [dnl -NXST_FLOW request (xid=0x4): priority=0 +NXST_FLOW request (xid=0x4): @&t@ ]) AT_CLEANUP @@ -876,7 +876,7 @@ AT_CHECK([ovs-ofctl ofp-print "\ 01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \ 00 00 00 01 00 00 00 00 ff ff 00 00 ff 00 00 00 \ "], [0], [dnl -NXST_AGGREGATE request (xid=0x4): priority=0 +NXST_AGGREGATE request (xid=0x4): @&t@ ]) AT_CLEANUP