From: Andy Zhou Date: Fri, 28 Jun 2013 22:20:49 +0000 (-0700) Subject: ovs-appctl: allow ofproto/trace to take mega flow input X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~7 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=ea5e3887dbf4bd1ae48649b228a07f5daecc59b2 ovs-appctl: allow ofproto/trace to take mega flow input ofproto/trace command was not updated to take mega flow input, which made it hard to use by cutting and pasting output from "ovs-dpctl dump-flows". (The mask is not actually used for tracing.) Bug #18267. Signed-off-by: Andy Zhou Signed-off-by: Ben Pfaff --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 4293824f0..420bfde0c 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5911,7 +5911,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, int argc, const char *argv[], { const struct dpif_backer *backer; struct ofproto_dpif *ofproto; - struct ofpbuf odp_key; + struct ofpbuf odp_key, odp_mask; struct ofpbuf *packet; struct ds result; struct flow flow; @@ -5921,6 +5921,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, int argc, const char *argv[], backer = NULL; ds_init(&result); ofpbuf_init(&odp_key, 0); + ofpbuf_init(&odp_mask, 0); /* Handle "-generate" or a hex string as the last argument. */ if (!strcmp(argv[argc - 1], "-generate")) { @@ -5941,7 +5942,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, int argc, const char *argv[], * bridge is specified. If function odp_flow_key_from_string() * returns 0, the flow is a odp_flow. If function * parse_ofp_exact_flow() returns 0, the flow is a br_flow. */ - if (!odp_flow_from_string(argv[argc - 1], NULL, &odp_key, NULL)) { + if (!odp_flow_from_string(argv[argc - 1], NULL, &odp_key, &odp_mask)) { /* If the odp_flow is the second argument, * the datapath name is the first argument. */ if (argc == 3) { @@ -6021,6 +6022,7 @@ exit: ds_destroy(&result); ofpbuf_delete(packet); ofpbuf_uninit(&odp_key); + ofpbuf_uninit(&odp_mask); } void