Commit Graph

67 Commits

Author SHA1 Message Date
Gerald Combs ba83bf145f Don't try to reassemble a zero-length fragment. Add a comment to
reassemble.c about the handling of zero-length fragments.

svn path=/trunk/; revision=15899
2005-09-20 17:23:19 +00:00
Ulf Lamping 55c3e85a95 fix reassembling problem I've introduced yesterday, by using fragment_add_seq_next() function instead of fragment_add()
in addition, I had to implement fragment_get_reassembled() in addition to fragment_get(), which works with reassembled_table

svn path=/trunk/; revision=15762
2005-09-12 00:16:57 +00:00
Ulf Lamping 0bb7a6e003 rename fragment_add_dcerpc -> fragment_add_dcerpc_dg to avoid confusion a bit,
as connection oriented (cn) and connectionless (dg) DCE/RPC uses different ways to handle defragmentation and this function is only used for dg

svn path=/trunk/; revision=15757
2005-09-11 21:10:26 +00:00
Ulf Lamping 541fd750b8 fix DCE/RPC defragmentation, if both middle and last DCE/RPC fragments are in the same TCP desegmented data blob
reassemble.c:
I had to change the way the reassemble code works if the dissector is telling that more fragments *will* follow. In this case the reassemble code shouldn't try to reassemble already at that time ...

I've also changed the way if a fragment was already seen or not, as it's not enough to check for the frame number, in the scenario described above.

Unfortunately both changes *might* broke other protocols from reassemble properly. I've checked with excessive TCP desegmentation and it's still working without any changes :-)

packet-dcerpc.c:
use a tvb subset to limit the "end of bytes" processed in a single fragment dissect run, as each fragment has it's own DCE/RPC header (and isn't part of the stub data of the previous packet).

svn path=/trunk/; revision=15744
2005-09-10 15:11:21 +00:00
Ronnie Sahlberg 99d08f067e remove two more GMemChunks
svn path=/trunk/; revision=15348
2005-08-14 01:26:34 +00:00
Guy Harris 0c5af0dde6 If we do reassembly and hand the packet to the dissector, and the
dissector says "sorry, I need even more data in this packet", don't flag
that packet as being reassembled in that frame.  Indicate that we should
perhaps do all the "partial reassembly" stuff in
"fragment_set_partial_assembly()", which would obviate the need for the
hack in the TCP dissector.

Clean up indentation.

svn path=/trunk/; revision=15139
2005-07-29 07:14:32 +00:00
Jörg Mayer 7949c7f31c char -> const char warning fixes
svn path=/trunk/; revision=15079
2005-07-26 08:01:16 +00:00
Guy Harris 7a6f0a102c When reassembling a packet, all data, including data with
FD_NOT_MALLOCED set, has to be copied - all FD_NOT_MALLOCED means is
that the fragment's data is part of the old reassembled data, rather
than a malloced chunk of its own (this happens if, after reassembly, the
dissector says more reassembly is necessary, as can happen, for example,
in the case of HTTP and other protocols where reassembly continues until
a terminator is seen).  Not copying the data means that the reassembled
data is, in part, whatever random junk happens to be in the
newly-allocated buffer.

Back out the change not to copy the data, but add some sanity checks, in
the hopes of preventing the crash that caused the change not to copy the
data to be added, and in the hopes of discovering the ultimate source of
that crash and fixing it.

svn path=/trunk/; revision=15057
2005-07-25 18:03:19 +00:00
Guy Harris 72560a2e04 Fix indentation.
svn path=/trunk/; revision=15050
2005-07-24 22:01:14 +00:00
Guy Harris 72c01a62f8 "fragment_add_common()" isn't used outside this file - make it static.
Move to "show_fragment()" the code to append the fragment information to
the top-level item.

Fix indentation.

svn path=/trunk/; revision=15042
2005-07-24 17:48:10 +00:00
Gerald Combs 276f179b0b Don't crash if we're handed a zero-length fragment. Fixes bug 272. Although
we don't crash now, we still don't handle zero-length fragments correctly.

svn path=/trunk/; revision=14858
2005-07-05 20:04:03 +00:00
Ulf Lamping 56a9fe6d2a add a generated toplevel line between the connectionless DCE/RPC protocol and the defragmented DCE/RPC content, to better understand what's going on if defragmentation is done.
svn path=/trunk/; revision=14531
2005-06-02 20:55:58 +00:00
Ulf Lamping e2c3b60280 add a generated toplevel line between the TCP protocol and the desegmented content, to better understand what's going on while desegmenting.
We'll have to add similar mechanisms for other protocols as well...

svn path=/trunk/; revision=14527
2005-06-02 18:52:55 +00:00
Gerald Combs 64cafdda21 From Peter Johansson: Fix a segmentation fault in the reassembly code.
Fix up the formatting a bit.

svn path=/trunk/; revision=14136
2005-04-19 14:17:22 +00:00
Gerald Combs 5eb73dd01b In fragment_unhash(), free our key data _after_ we remove the key from
the hash table so that fragment_equal() doesn't end up working with
recently-freed data.

svn path=/trunk/; revision=14096
2005-04-15 20:15:03 +00:00
Ulf Lamping 79daa1e80e use DISSECTOR_ASSERT instead of g_assert
svn path=/trunk/; revision=13871
2005-03-23 00:09:12 +00:00
Lars Roland ec9ca01616 Move the following files from /trunk to /trunk/epan:
asn1.[ch]
follow.[ch]
ptvcursor.[ch]
reassemble.[ch]
xmlstub.[ch]

fix #include statements accordingly.

svn path=/trunk/; revision=13366
2005-02-09 23:38:00 +00:00