ovn-trace crashes when there are dhcp flows, which makes the tool unusable. This patch is to fix the crash with a dummy dhcp_opts, until dhcp_opts is completely supported by ovn-trace.
Signed-off-by: Han Zhou <zhou...@gmail.com> --- ovn/utilities/ovn-trace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c index 487ae52..ff95fd6 100644 --- a/ovn/utilities/ovn-trace.c +++ b/ovn/utilities/ovn-trace.c @@ -331,6 +331,9 @@ static struct shash symtab; /* Address sets. */ static struct shash address_sets; +/* Dummy DHCP opts XXX */ +static struct hmap dummy_dhcp_opts; + static struct ovntrace_datapath * ovntrace_datapath_find_by_sb_uuid(const struct uuid *sb_uuid) { @@ -578,6 +581,7 @@ static void read_flows(void) { ovn_init_symtab(&symtab); + hmap_init(&dummy_dhcp_opts); const struct sbrec_logical_flow *sblf; SBREC_LOGICAL_FLOW_FOR_EACH (sblf, ovnsb_idl) { @@ -601,7 +605,7 @@ read_flows(void) struct ovnact_parse_params pp = { .symtab = &symtab, - .dhcp_opts = NULL /* XXX */, + .dhcp_opts = &dummy_dhcp_opts /* XXX */, .n_tables = 16, .cur_ltable = sblf->table_id, }; @@ -654,6 +658,8 @@ read_flows(void) HMAP_FOR_EACH (dp, sb_uuid_node, &datapaths) { qsort(dp->flows, dp->n_flows, sizeof *dp->flows, compare_flow); } + + hmap_destroy(&dummy_dhcp_opts); } static void -- 2.1.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev