Use ofputil_uninit_group_mod() instead of ofputil_bucket_list_destroy(). Currently these have the same effect, but this will change in a following patch.
Signed-off-by: Jarno Rajahalme <ja...@ovn.org> --- lib/ofp-parse.c | 6 +++--- lib/ofp-print.c | 4 ++-- ofproto/ofproto.c | 2 +- ovn/controller/ofctrl.c | 6 +++--- utilities/ovs-ofctl.c | 6 +----- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 8659079..56607f6 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -1590,7 +1590,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command, return NULL; out: - ofputil_bucket_list_destroy(&gm->buckets); + ofputil_uninit_group_mod(gm); return error; } @@ -1605,7 +1605,7 @@ parse_ofp_group_mod_str(struct ofputil_group_mod *gm, uint16_t command, free(string); if (error) { - ofputil_bucket_list_destroy(&gm->buckets); + ofputil_uninit_group_mod(gm); } return error; } @@ -1653,7 +1653,7 @@ parse_ofp_group_mod_file(const char *file_name, uint16_t command, size_t i; for (i = 0; i < *n_gms; i++) { - ofputil_bucket_list_destroy(&(*gms)[i].buckets); + ofputil_uninit_group_mod(&(*gms)[i]); } free(*gms); *gms = NULL; diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 919c95d..0b3bf01 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -2586,7 +2586,7 @@ ofp_print_group_desc(struct ds *s, const struct ofp_header *oh) ds_put_char(s, ' '); ofp_print_group(s, gd.group_id, gd.type, &gd.buckets, &gd.props, oh->version, false); - ofputil_bucket_list_destroy(&gd.buckets); + ofputil_uninit_group_desc(&gd); } } @@ -2747,7 +2747,7 @@ ofp_print_group_mod(struct ds *s, const struct ofp_header *oh) return; } ofp_print_group_mod__(s, oh->version, &gm); - ofputil_bucket_list_destroy(&gm.buckets); + ofputil_uninit_group_mod(&gm); } static void diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index dca620c..cd0c90f 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -6980,7 +6980,7 @@ handle_group_mod(struct ofconn *ofconn, const struct ofp_header *oh) ofmonitor_flush(ofproto->connmgr); ovs_mutex_unlock(&ofproto_mutex); - ofputil_bucket_list_destroy(&ogm.gm.buckets); + ofputil_uninit_group_mod(&ogm.gm); return error; } diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c index dd9f5ec..79d840d 100644 --- a/ovn/controller/ofctrl.c +++ b/ovn/controller/ofctrl.c @@ -365,7 +365,7 @@ run_S_CLEAR_FLOWS(void) gm.command_bucket_id = OFPG15_BUCKET_ALL; ovs_list_init(&gm.buckets); queue_msg(encode_group_mod(&gm)); - ofputil_bucket_list_destroy(&gm.buckets); + ofputil_uninit_group_mod(&gm); /* Clear installed_flows, to match the state of the switch. */ ovn_flow_table_clear(); @@ -936,7 +936,7 @@ ofctrl_put(struct group_table *group_table, int64_t nb_cfg) free(error); } ds_destroy(&group_string); - ofputil_bucket_list_destroy(&gm.buckets); + ofputil_uninit_group_mod(&gm); } } @@ -1051,7 +1051,7 @@ ofctrl_put(struct group_table *group_table, int64_t nb_cfg) free(error); } ds_destroy(&group_string); - ofputil_bucket_list_destroy(&gm.buckets); + ofputil_uninit_group_mod(&gm); /* Remove 'installed' from 'group_table->existing_groups' */ hmap_remove(&group_table->existing_groups, &installed->hmap_node); diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 3ee7879..db4cf8a 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -2525,10 +2525,10 @@ ofctl_group_mod__(const char *remote, struct ofputil_group_mod *gms, if (request) { transact_noreply(vconn, request); } + ofputil_uninit_group_mod(gm); } vconn_close(vconn); - } @@ -2547,9 +2547,6 @@ ofctl_group_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command) ovs_fatal(0, "%s", error); } ofctl_group_mod__(argv[1], gms, n_gms, usable_protocols); - for (i = 0; i < n_gms; i++) { - ofputil_bucket_list_destroy(&gms[i].buckets); - } free(gms); } @@ -2569,7 +2566,6 @@ ofctl_group_mod(int argc, char *argv[], uint16_t command) ovs_fatal(0, "%s", error); } ofctl_group_mod__(argv[1], &gm, 1, usable_protocols); - ofputil_bucket_list_destroy(&gm.buckets); } } -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev