X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.c;h=7174748b5205a5c3fd1161cc2142f1f136af16c9;hb=26ce31583b1654a3acaaf6de8e9567e327fbc104;hp=c632df64ceb870bfe7196676469cf153c69eb45c;hpb=2f2df2f4dafada02f022c2900f7a17628af7a0d1;p=openvswitch diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index c632df64..7174748b 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3354,6 +3354,7 @@ xlate_actions(struct action_xlate_ctx *ctx, ctx->priority = 0; ctx->base_priority = 0; ctx->base_flow = ctx->flow; + ctx->base_flow.tun_id = 0; ctx->table_id = 0; if (process_special(ctx->ofproto, &ctx->flow, ctx->packet)) { @@ -4098,8 +4099,8 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, const char *args_, arg1 = strtok_r(NULL, " ", &save_ptr); arg2 = strtok_r(NULL, " ", &save_ptr); arg3 = strtok_r(NULL, "", &save_ptr); /* Get entire rest of line. */ - if (dpname && arg1 && !arg2 && !arg3) { - /* ofproto/trace dpname flow */ + if (dpname && arg1 && (!arg2 || !strcmp(arg2, "-generate")) && !arg3) { + /* ofproto/trace dpname flow [-generate] */ int error; /* Convert string to datapath key. */ @@ -4116,6 +4117,12 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, const char *args_, unixctl_command_reply(conn, 501, "Invalid flow"); goto exit; } + + /* Generate a packet, if requested. */ + if (arg2) { + packet = ofpbuf_new(0); + flow_compose(packet, &flow); + } } else if (dpname && arg1 && arg2 && arg3) { /* ofproto/trace dpname tun_id in_port packet */ uint16_t in_port;