From 0b090f2263807e25be14f90a287c4bfdee2d82ec Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Mon, 15 Jun 2015 12:15:44 -0700 Subject: [PATCH] ofctrl: Don't use designated initializers. MSVC 2013 does not like designated initializers when structs are initialized inside structs. Apparently it has been fixed in MSVC 2015. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- ovn/controller/ofctrl.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c index bc4e8d437..2f1767a1e 100644 --- a/ovn/controller/ofctrl.c +++ b/ovn/controller/ofctrl.c @@ -401,12 +401,12 @@ ofctrl_update_flows(void) if (!d) { /* Installed flow is no longer desirable. Delete it from the * switch and from installed_flows. */ - struct ofputil_flow_mod fm = { - .match = i->match, - .priority = i->priority, - .table_id = i->table_id, - .command = OFPFC_DELETE_STRICT, - }; + struct ofputil_flow_mod fm; + memset(&fm, 0, sizeof fm); + fm.match = i->match; + fm.priority = i->priority; + fm.table_id = i->table_id; + fm.command = OFPFC_DELETE_STRICT; queue_flow_mod(&fm); ovn_flow_log(i, "removing"); @@ -416,14 +416,14 @@ ofctrl_update_flows(void) if (!ofpacts_equal(i->ofpacts, i->ofpacts_len, d->ofpacts, d->ofpacts_len)) { /* Update actions in installed flow. */ - struct ofputil_flow_mod fm = { - .match = i->match, - .priority = i->priority, - .table_id = i->table_id, - .ofpacts = d->ofpacts, - .ofpacts_len = d->ofpacts_len, - .command = OFPFC_MODIFY_STRICT, - }; + struct ofputil_flow_mod fm; + memset(&fm, 0, sizeof fm); + fm.match = i->match; + fm.priority = i->priority; + fm.table_id = i->table_id; + fm.ofpacts = d->ofpacts; + fm.ofpacts_len = d->ofpacts_len; + fm.command = OFPFC_MODIFY_STRICT; queue_flow_mod(&fm); ovn_flow_log(i, "updating"); @@ -446,14 +446,14 @@ ofctrl_update_flows(void) struct ovn_flow *d; HMAP_FOR_EACH_SAFE (d, next, hmap_node, &desired_flows) { /* Send flow_mod to add flow. */ - struct ofputil_flow_mod fm = { - .match = d->match, - .priority = d->priority, - .table_id = d->table_id, - .ofpacts = d->ofpacts, - .ofpacts_len = d->ofpacts_len, - .command = OFPFC_ADD, - }; + struct ofputil_flow_mod fm; + memset(&fm, 0, sizeof fm); + fm.match = d->match; + fm.priority = d->priority; + fm.table_id = d->table_id; + fm.ofpacts = d->ofpacts; + fm.ofpacts_len = d->ofpacts_len; + fm.command = OFPFC_ADD; queue_flow_mod(&fm); ovn_flow_log(d, "adding"); -- 2.39.5