X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-print.c;h=d4f33daa970bf7baa1d1c5ce192099f45994fca2;hb=0b13821fe00d918e24c71419355a10b65081a71a;hp=0e2cb0f8004635eaa509cf9b7a00df5e99331cbe;hpb=c4617b3c28b9a96e09fdbbe2682b875dbfeaec5b;p=openvswitch diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 0e2cb0f8..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); } @@ -1315,8 +1319,7 @@ ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh, for (; n--; ts++) { char name[OFP_MAX_TABLE_NAME_LEN + 1]; - strncpy(name, ts->name, sizeof name); - name[OFP_MAX_TABLE_NAME_LEN] = '\0'; + ovs_strlcpy(name, ts->name, sizeof name); ds_put_format(string, " %d: %-8s: ", ts->table_id, name); ds_put_format(string, "wild=0x%05"PRIx32", ", ntohl(ts->wildcards));