ofp-print: Avoid converting flow to ofp_match just to format it.
authorBen Pfaff <blp@nicira.com>
Tue, 9 Nov 2010 00:36:44 +0000 (16:36 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 22 Nov 2010 17:40:34 +0000 (09:40 -0800)
These days we have a function to format a struct flow directly, so we might
as well use it.

lib/ofp-print.c

index 507ed7db35c8751a951def7e33284604f45a0692..f6560747e492076272167a3bc71b6ad24843c39a 100644 (file)
@@ -133,12 +133,11 @@ ofp_packet_in(struct ds *string, const void *oh, size_t len, int verbosity)
     if (verbosity > 0) {
         struct flow flow;
         struct ofpbuf packet;
-        struct ofp_match match;
+
         packet.data = (void *) op->data;
         packet.size = data_len;
         flow_extract(&packet, 0, ntohs(op->in_port), &flow);
-        flow_to_match(&flow, 0, false, &match);
-        ofp_print_match(string, &match, verbosity);
+        flow_format(string, &flow);
         ds_put_char(string, '\n');
     }
     if (verbosity > 1) {