X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif-xlate.c;h=a5b6814aae06156256b8ed65e2ac59ac06e7b7ab;hb=1b63b91eb085b381d0a765855a11a27d9d43c27d;hp=cb0912315a144762fd241e7ef6b587b70630cb79;hpb=8b81d1ef3ca5f1815267a12d44b6ebc96b5a45c1;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index cb0912315..a5b6814aa 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -2096,7 +2096,8 @@ static void xlate_learn_action(struct xlate_ctx *ctx, const struct ofpact_learn *learn) { - struct ofputil_flow_mod *fm; + uint64_t ofpacts_stub[1024 / 8]; + struct ofputil_flow_mod fm; struct ofpbuf ofpacts; ctx->xout->has_learn = true; @@ -2107,11 +2108,10 @@ xlate_learn_action(struct xlate_ctx *ctx, return; } - fm = xmalloc(sizeof *fm); - ofpbuf_init(&ofpacts, 0); - learn_execute(learn, &ctx->xin->flow, fm, &ofpacts); - - ofproto_dpif_flow_mod(ctx->xbridge->ofproto, fm); + ofpbuf_use_stub(&ofpacts, ofpacts_stub, sizeof ofpacts_stub); + learn_execute(learn, &ctx->xin->flow, &fm, &ofpacts); + ofproto_dpif_flow_mod(ctx->xbridge->ofproto, &fm); + ofpbuf_uninit(&ofpacts); } static void