Ethereal-dev: Re: [Ethereal-dev] General problem for reassembling WTP packets

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 26 Apr 2003 17:55:15 -0700
On Sat, Apr 26, 2003 at 04:13:13PM +0200, Georg von Zezschwitz wrote:
> I can think of two approaches to solve this:
>  1) The hash_table is invalidated for a certain IP on a "stop"
>     event (e.g. WSP disconnect for WAP).
>  2) A timeout is used, which only glues fragments together, if
>     they fall within a defined time frame. I guess this is
>     the better and more general approach.

 3) When reassembly completes for a given packet ID, don't leave
    the reassembly table around for that packet ID, mark it as
    "done" and move it to a different hash table, so subsequent
    fragments with the same packet ID start a new reassembly.

See "fragment_add_seq_check()" and the dissectors that use it for an
example of how to implement approach 3).