Ethereal-dev: Re: [ethereal-dev] Why are we doing a conversation_init in rescan_packets in fi

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 24 Aug 2000 11:28:06 -0700 (PDT)
> >Why is
> >
> >	discarding all the state, resetting the "visited" flag to 0, and
> >	redissecting all the packets on a subsequent pass through the
> >	file
> >
> >any different from
> >
> >	closing the file, reopening it, and rereading it?
> 
> Because of per-frame state information.
> 
> In the second case, the per-frame state information is removed. In the
> first case, this does not happen.

"Removed" in what sense?

It *does* get freed; in the first case, I said:

	Why is

		discarding all the state, resetting the "visited" flag
		^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		to 0, and redissecting all the packets on a subsequent pass
		^^^^
		through the file

"Discarding all the state" includes calling "init_all_protocols()",
which calls "packet_init_protocol()" as that was registered as an init
routine, and that frees all the per-frame data.

Now, there was a *BUG* wherein, on a rescan, we weren't clearing the
pointers to the per-frame data in the "frame_data" structure, i.e. 
there were pointers to data that had been freed, but I checked in a
fix for that bug last night.

> Now, I think that I probably should revisit the per-frame code and add a
> method to re-initialize it,

There already is; see above.