diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-10-12 21:37:02 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-10-12 21:37:02 +0000 |
commit | c91c1df500cc3950cc7a375aaae72f20ea0eb652 (patch) | |
tree | 34af7abdf706f06c2e9a44c55f877bcebeb600fa /epan/packet.c | |
parent | c5e0d7ce3265b40d4ad49b670691224792551987 (diff) | |
download | wireshark-c91c1df500cc3950cc7a375aaae72f20ea0eb652.tar.gz |
Use seasonal allocation for name resolution. This effectively scrubs our
resolution information between capture files so that we don't leak host
entries from one file to another (e.g. embarassing-host-name.example.com
from file1.pcapng into a name resolution block in file2.pcapng).
host_name_lookup_cleanup and host_name_lookup_init must now be called
after each call to se_free_all. As a result we now end up reading our
various name resolution files much more than we should.
svn path=/trunk/; revision=45511
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/epan/packet.c b/epan/packet.c index ba8bfd364b..cd0f6f1b49 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -128,6 +128,13 @@ init_dissection(void) /* Reclaim and reinitialize all memory of seasonal scope */ se_free_all(); + /* + * Reinitialize resolution information. We do initialization here in + * case we need to resolve between captures. + */ + host_name_lookup_cleanup(); + host_name_lookup_init(); + /* Initialize the table of conversations. */ epan_conversation_init(); @@ -167,6 +174,13 @@ cleanup_dissection(void) /* Initialize the expert infos */ expert_cleanup(); + + /* + * Reinitialize resolution information. We do initialization here in + * case we need to resolve between captures. + */ + host_name_lookup_cleanup(); + host_name_lookup_init(); } /* Allow protocols to register a "cleanup" routine to be @@ -895,7 +909,7 @@ dissector_reset_uint(const char *name, const guint32 pattern) gboolean dissector_try_uint_new(dissector_table_t sub_dissectors, const guint32 uint_val, - tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name, void *data) { dtbl_entry_t *dtbl_entry; @@ -1244,7 +1258,7 @@ dissector_compare_filter_name(gconstpointer dissector_a, gconstpointer dissector else b_name = proto_get_protocol_filter_name(proto_get_id(b->protocol)); - ret = strcmp(a_name, b_name); + ret = strcmp(a_name, b_name); return ret; } |