ofp-print: Don't print priority for flow stats requests.
authorBen Pfaff <blp@nicira.com>
Fri, 25 Feb 2011 00:58:40 +0000 (16:58 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 25 Feb 2011 01:13:30 +0000 (17:13 -0800)
A flow stats or aggregate stats request does not have a priority, but we
were printing one anyway.

Reported-by: Justin Pettit <jpettit@nicira.com>
lib/ofp-print.c
tests/ofp-print.at

index bf9bf82..d4f33da 100644 (file)
@@ -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);
 }
index 5b3c849..af5249b 100644 (file)
@@ -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