path: root/file.c
diff options
authorStig Bjørlykke <stig@bjorlykke.org>2016-04-09 14:30:07 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2016-04-11 17:59:11 +0000
commit5112d1ec27e0b37fe4194fbc627877e28c027261 (patch)
treeeedf66594271057d7b93fa552af298e972d13647 /file.c
parent76adb4c044fca4b56346a01d655a04bf56fe770c (diff)
Lua: Fix add and remove Fields when reload Lua plugins
Reset wslua_dfilter and remove the Field tap_listener when reloading plugins. Check for tap listeners in rescan_packets() after ws_epan_new() because Lua may register the Lua field tap when adding Fields. Bug: 12328 Change-Id: Ibbd8339033132c6f3b61d7e9c9ced9ed2b9affec Reviewed-on: https://code.wireshark.org/review/14871 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'file.c')
1 files changed, 6 insertions, 0 deletions
diff --git a/file.c b/file.c
index a0c21b2ddb..04fd8becc9 100644
--- a/file.c
+++ b/file.c
@@ -1630,6 +1630,12 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, gb
cf->epan = ws_epan_new(cf);
cf->cinfo.epan = cf->epan;
+ /* A new Lua tap listener may be registered in lua_prime_all_fields()
+ called via epan_new() / init_dissection() when reloading Lua plugins. */
+ if (!create_proto_tree && have_filtering_tap_listeners()) {
+ create_proto_tree = TRUE;
+ }
/* We need to redissect the packets so we have to discard our old
* packet list store. */