X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-print.c;h=f6425318cea59d28de519ce67d46ba2eef97b3b2;hb=87eeed4c03ebb0847c093eeb8a6b7af5f2fd33af;hp=5d06b96f9df4cafe5751846ac7730a49c288b04b;hpb=abaad8cf1b5089e17a4af0ab1ff644bfcf63cad9;p=openvswitch diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 5d06b96f..f6425318 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -16,10 +16,10 @@ #include #include "ofp-print.h" -#include "xtoxll.h" #include #include +#include #include #include #include @@ -35,6 +35,7 @@ #include "packets.h" #include "pcap.h" #include "util.h" +#include "xtoxll.h" static void ofp_print_port_name(struct ds *string, uint16_t port); @@ -933,11 +934,16 @@ ofp_desc_stats_reply(struct ds *string, const void *body, { const struct ofp_desc_stats *ods = body; - ds_put_format(string, "Manufacturer: %s\n", ods->mfr_desc); - ds_put_format(string, "Hardware: %s\n", ods->hw_desc); - ds_put_format(string, "Software: %s\n", ods->sw_desc); - ds_put_format(string, "Serial Num: %s\n", ods->serial_num); - ds_put_format(string, "DP Description: %s\n", ods->dp_desc); + ds_put_format(string, "Manufacturer: %.*s\n", + (int) sizeof ods->mfr_desc, ods->mfr_desc); + ds_put_format(string, "Hardware: %.*s\n", + (int) sizeof ods->hw_desc, ods->hw_desc); + ds_put_format(string, "Software: %.*s\n", + (int) sizeof ods->sw_desc, ods->sw_desc); + ds_put_format(string, "Serial Num: %.*s\n", + (int) sizeof ods->serial_num, ods->serial_num); + ds_put_format(string, "DP Description: %.*s\n", + (int) sizeof ods->dp_desc, ods->dp_desc); } static void @@ -994,10 +1000,10 @@ ofp_flow_stats_reply(struct ds *string, const void *body_, size_t len, break; } - ds_put_format(string, " cookie=%"PRIu64"s, ", ntohll(fs->cookie)); + ds_put_format(string, " cookie=%"PRIu64", ", ntohll(fs->cookie)); ds_put_format(string, "duration_sec=%"PRIu32"s, ", ntohl(fs->duration_sec)); - ds_put_format(string, "duration_nsec=%"PRIu32"s, ", + ds_put_format(string, "duration_nsec=%"PRIu32"ns, ", ntohl(fs->duration_nsec)); ds_put_format(string, "table_id=%"PRIu8", ", fs->table_id); ds_put_format(string, "priority=%"PRIu16", ",