From: Ben Pfaff Date: Wed, 8 Dec 2010 20:05:20 +0000 (-0800) Subject: ofp-print: Print each flow at the start of a line. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab8fadba0670ab21c8f68eab22e106be40d2ceb;p=openvswitch ofp-print: Print each flow at the start of a line. Before this commit, the first flow in "ovs-ofctl dump-flows" output was printed on the same line as the OpenFlow message type name and the xid. With this commit, that flow is put on a line of its own, like all of the other flows in the output. Requested-by: Paul Ingram CC: Paul Ingram --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index e199ac9f..4141b9f9 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -1069,6 +1069,8 @@ ofp_print_ofpst_flow_reply(struct ds *string, const struct ofp_header *oh, ptrdiff_t bytes_left = body + len - pos; size_t length; + ds_put_char(string, '\n'); + if (bytes_left < sizeof *fs) { if (bytes_left != 0) { ds_put_format(string, " ***%td leftover bytes at end***", @@ -1118,7 +1120,6 @@ ofp_print_ofpst_flow_reply(struct ds *string, const struct ofp_header *oh, } ofp_print_match(string, &fs->match, verbosity); ofp_print_actions(string, fs->actions, length - sizeof *fs); - ds_put_char(string, '\n'); pos += length; }