Ethereal-dev: Re: [Ethereal-dev] SPX Dissection problem.
On Wed, Apr 09, 2003 at 09:52:49AM -0600, Greg Morris wrote:
> You made some changes to the SPX dissection but now after the forst run
> when you click on an SPX packet Ethereal crashes because spx_hash_keys
> in function spx_hash_insert is 0 value. Attached is a trace containing
> SPX traffic.
>
> spx_info*
> spx_hash_insert(conversation_t *conversation, guint32 spx_src)
> {
> spx_hash_key *key;
> spx_info *value;
>
> /* Now remember the packet, so we can find it if we later. */
> key = g_mem_chunk_alloc(spx_hash_keys);
>
> I suspect that the spx_hash_key structure was released from memory?
Yes - and the hash table was destroyed as well.
I've checked in a change not to use the hash table after the first pass;
instead, on the first pass, we attach to frames that are retransmissions
a data structure that contains the frame number of the original frame,
and a pointer to that structure is what gets passed to subdissectors
(or, if there is no such structure, a null pointer gets passed).
That means we can safely get rid of the hash table after the first pass
- including getting rid of the hash values.
BTW, as per my earlier mail, is there any reason to call subdissectors
of the SPX dissector for retransmissions? That way, the NDPS
subdissector wouldn't have to care whether the frame was a
retransmission; it could assume that it isn't.