From ae602adc43835e56ce388d11c55aa2599a6fa8ad Mon Sep 17 00:00:00 2001 From: Jean Tourrilhes Date: Wed, 4 Nov 2009 23:40:18 -0800 Subject: [PATCH] Revert "ovs-ofctl: Fix use-after-free error in del-flows command." This reverts commit cae7a4b90a55cbfd4cfd23c06f9f09cd429ab4c0. This commit forced the user to specify an action when deleting a flow, which is not desirable. The change was not actually needed, as the buffer is never passed to str_to_flow() in the original code. --- utilities/ovs-ofctl.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 9efd484f..76114159 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -948,15 +948,11 @@ static void do_del_flows(const struct settings *s, int argc, char *argv[]) uint16_t out_port; struct ofpbuf *buffer; struct ofp_flow_mod *ofm; - struct ofp_match match; - /* Parse and send. str_to_flow() will expand and reallocate the data in - * 'buffer', so we can't keep pointers to across the str_to_flow() call. */ - make_openflow(sizeof *ofm, OFPT_FLOW_MOD, &buffer); - str_to_flow(argc > 2 ? argv[2] : "", &match, buffer, - NULL, &out_port, &priority, NULL, NULL); - ofm = buffer->data; - ofm->match = match; + /* Parse and send. */ + ofm = make_openflow(sizeof *ofm, OFPT_FLOW_MOD, &buffer); + str_to_flow(argc > 2 ? argv[2] : "", &ofm->match, NULL, NULL, + &out_port, &priority, NULL, NULL); if (s->strict) { ofm->command = htons(OFPFC_DELETE_STRICT); } else { -- 2.30.2