diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2021-02-06 19:42:52 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2021-02-07 19:24:38 +0000 |
commit | 395af33e745a94ea11debe14c02304d0f79852e1 (patch) | |
tree | 0f12c9f5e4388b9bb09b1725a8b666f5a413fc3c /epan/dissectors/packet-ansi_a.c | |
parent | 67b4680bcab1a7a8c1f5a5e6b9d82c8cc5f2da99 (diff) |
ansi_a: dtap stats: populate table rows only once
If the init function is called and the statistics table already exists, it's
sufficient to clear the data that was collected when the tap parsed the
packets.
Fix a typo in a comment while at it.
Fixes: 8963dff518 ("ansi_a: dtap statistics: create the table only once")
Diffstat (limited to 'epan/dissectors/packet-ansi_a.c')
-rw-r--r-- | epan/dissectors/packet-ansi_a.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 4e23e0aa88..299be2a888 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -10582,12 +10582,17 @@ static void ansi_a_dtap_stat_init(stat_tap_table_ui* new_stat) stat_tap_table_item_type items[sizeof(dtap_stat_fields)/sizeof(stat_tap_table_item)]; table = stat_tap_find_table(new_stat, table_name); - if (!table) { - table = stat_tap_init_table(table_name, num_fields, 0, NULL); - stat_tap_add_table(new_stat, table); + if (table) { + if (new_stat->stat_tap_reset_table_cb) { + new_stat->stat_tap_reset_table_cb(table); + } + return; } - /* Add a fow for each value type */ + table = stat_tap_init_table(table_name, num_fields, 0, NULL); + stat_tap_add_table(new_stat, table); + + /* Add a row for each value type */ while (ansi_a_dtap_strings[i].strptr) { items[IEI_COLUMN].type = TABLE_ITEM_UINT; |