Commit Graph

140 Commits

Author SHA1 Message Date
Alexis La Goutte ea63ba2c8f Fix some Dead Store (Dead initialization) Warning found by Clang Fix also indent (Use tabs)
svn path=/trunk/; revision=48983
2013-04-22 21:25:12 +00:00
Evan Huus 513698ca76 Fix typo - we want to check if the pointer is NULL, not if the value
pointed to is NULL.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8599

svn path=/trunk/; revision=48943
2013-04-20 21:09:41 +00:00
Guy Harris c2087da0ab When we throw a reassembly error, remember the error, so that, if we
revisit this reassembly (in a multi-pass program such as Wireshark, or
TShark with -2), we'll throw the same error.

In fragment_set_tot_len(), allow the length to be set to a value that's
before the offset of existing fragments; we'll catch that later when the
reassembly completes.  This lets us handle some problems with DTLS less
confusingly.

When adding frames to an already-completed reassembly, check for
fragments that overlap existing fragments or go past the end of the
reassembly, and report errors.

When completing a reassembly, make the buffer for the reassembled data
big enough to contain the specified data length for the reassembly, even
if that's less than the offset + length of the last fragment.  Flag all
fragments that go past that length as "too long", and only copy out what
part of them fits, if any.  That lets us flag the correct fragment or
fragments as being "too long".

When adding fragments, do some additional checks, even if we're not
doing the first pass through the packets, so errors that show up in the
first pass also show up on subsequent passes.

svn path=/trunk/; revision=48909
2013-04-18 02:31:45 +00:00
Guy Harris da76e5a997 Include a message with all ReassemblyError exceptions; they're expected
to have a message indicating the precise error.

svn path=/trunk/; revision=48554
2013-03-25 22:36:29 +00:00
Evan Huus 0314bd1c1b From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8502
Allow reassembly of sequences when the sequence numbers do not count from 0.

svn path=/trunk/; revision=48548
2013-03-25 12:53:26 +00:00
Anders Broman 5abba34e9c make local functions static.
svn path=/trunk/; revision=48523
2013-03-24 14:03:12 +00:00
Guy Harris eee846b9c6 Make reassembly_table_destroy() clear the function pointers and empty
and destroy the reassembled table.

svn path=/trunk/; revision=48492
2013-03-23 02:40:37 +00:00
Guy Harris a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman 94d102adb4 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48318
2013-03-15 16:36:31 +00:00
Evan Huus f6156140c3 Followup to r48011, answering my own XXX comment:
No, ReportedBoundsError is not the right thing to throw, ReassemblyError is.
That's why I added it in the first place!

svn path=/trunk/; revision=48123
2013-03-06 00:39:35 +00:00
Evan Huus b20db86a6f Define a new exception for reassembly errors, and throw it in several cases
instead of using DISSECTOR_ASSERT. When a dissector passes bad data to the
reassembly machine, that isn't necessarily the dissector's fault - the data may
come straight from the packet, and the dissector may not have enough information
to know it's bad without telling the reassembly machine in the first place.

Also fix a bug in the reassembly machine. If it were given a fragment and all of
the following conditions were met:
- the other associated fragments were already marked as done (reassembled)
- the fragment went beyond the end of the conceptual reassembled buffer
- the dissector had not set the PARTIAL_REASSEMBLY flag
then the reassembly machine would incorrectly think there was an overlap and
run past the end of the already-reassembled buffer.

Should fix the rest of
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8380

#BACKPORT
This is probably too big and intrusive to backport directly, and parts of it
will need adapting anyways since reassemble.c has changed. But the bug exists
and crashes in 1.6 and 1.8, so we'll have to do something.


svn path=/trunk/; revision=48011
2013-03-02 16:39:56 +00:00
Martin Kaiser d3b504f331 From Evan:
sanity checks before setting a packet's total length in
fragment_set_tot_len()

(from me: check if fragments exist for the given id)

hopefully, this fixes #8111 and #8163 without causing troubles for other
protocols that use fragmentation and reassembly

svn path=/trunk/; revision=46999
2013-01-08 22:18:52 +00:00
Evan Huus 347a8a2115 Add full modelines and minor whitespace fixes.
svn path=/trunk/; revision=46812
2012-12-27 18:58:08 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jeff Morriss aa5d9d78dd From Robert Bullen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 :
The reassembled fragments tree in the Packet Details view is awesome, but it
lacks one thing: a field that exposes the reassembled data.

tcp.data already exists for exposing a single TCP segment's payload as a byte
array. It would be handy to have something similar for a single application
layer PDU when TCP segment reassembly is involved. I propose
tcp.reassembled.data, named and placed after the already existing field
tcp.reassembled.length.

My primary use case for this feature is outputting tcp.reassembled.data with
tshark for further processing with a script.

The attached patch implements this very feature. Because the reassembled
fragment tree code is general purpose, i.e. not specific to just TCP, any
dissector that relies upon it can add a similar field very cheaply. In that
vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which
expose reassembled fragment data as a single byte stream for IPv4 and IPv6,
respectively. All other protocols that use the reassembly code have been left
alone, other than inserting NULL into their initializer lists for the newly
introduced struct field reassemble.h:fragment_items.hf_reassembled_data.

svn path=/trunk/; revision=44802
2012-09-07 02:09:59 +00:00
Bill Meier 38b39b6b77 Add 'fragment_table_destroy()'
svn path=/trunk/; revision=44459
2012-08-12 20:53:17 +00:00
Bill Meier 103ddcbfd5 Use g_slice allocation for 'reassembled_table' keys (instead of se allocation).
Not strictly required, but IMO a bit cleaner (if maybe a bit less efficient).

svn path=/trunk/; revision=44382
2012-08-09 14:55:13 +00:00
Bill Meier 3c7d32017f From Jakub Zawadzki: Fix for memory leak in reassemble.c
Bug #4141

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4141#c10

svn path=/trunk/; revision=44371
2012-08-09 02:06:53 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss 89cfdc3559 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -
make Save-As/Displayed/All-Packets save not only the displayed packets but
also any other packets needed (e.g., for reassembly) to fully dissect the
displayed packets.

This works only for the "All packets" case; choosing only the Selected packet,
the Marked packets, or a range of packets would require actually storing which
packets depend on which (too much memory) or going through the packet list many
times (too slow).  Also, this behavior is always the case: you can't save the
displayed packets without their dependencies (I don't see why this would be
desirable).

So far this is done for SCTP and things using the reassembly routines (TCP has
been tested).

The Win32 dialog was modified but hasn't been tested yet.

One confusing aspect of the UI is that the Displayed count in the Save-As
dialog does not match the number of displayed packets.  (I tried renaming the
button "Displayed + Dependencies" but it looked too big.)  The tooltip tries
to explain this and the fact that this works only in the All-Packets case;
suggestions for improvement are welcome.


Implementation details:

Dissectors (or the reassembly code) can list frames which were needed to
build the current frame's tree.  If the current frame passes the display
filter then each listed frame is marked as "depended upon" (this takes up the
last free frame_data flag).

When performing a Save-As/Displayed/All-Packets then choose packets which
passed the dfilter _or_ are depended upon.

svn path=/trunk/; revision=41216
2012-02-28 03:19:49 +00:00
Bill Meier 439adbdbcc Remove obsolete comments referring to mem_chunks.
svn path=/trunk/; revision=40507
2012-01-14 20:14:43 +00:00
Jörg Mayer 71520b8759 Remove obsolete GLIB_CHECK_VERSION(2,10,0) checks
svn path=/trunk/; revision=40490
2012-01-14 03:21:28 +00:00
Bill Meier 231f36be53 (Trivial) Fix a typo in a comment.
svn path=/trunk/; revision=39089
2011-09-22 15:57:41 +00:00
Stig Bjørlykke cea89ebc80 Use ENC_NA for hf_fragments (FT_NONE).
svn path=/trunk/; revision=38124
2011-07-19 19:37:45 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Jeff Morriss 166b14c1df As suggested by Anders: back out 37112.
svn path=/trunk/; revision=37123
2011-05-13 14:21:58 +00:00
Anders Broman 464486e1c5 We should get rid of g_mem_chunk_alloc() as it leaks memory
http://www.wireshark.org/lists/wireshark-dev/200910/msg00074.html
g_slice allocing the keys should make it possible to walk the
fragment table and free the fragments once they are g_slice_alloced.
It remains fo figure out how to do that.

svn path=/trunk/; revision=37112
2011-05-13 05:19:23 +00:00
Chris Maynard a1fcd675e1 From Jakub Zawadzki via wireshark-dev: Fix comment.
svn path=/trunk/; revision=36223
2011-03-21 13:28:20 +00:00
Jeff Morriss 4ed0e07ef0 When reassembling fragments, don't stop looking at fragments just because the
current fragment pushes us past the reassembled size: it may be that the
current fragment is a duplicate/retransmission and will be ignored.

Also, if we detect a conflict between a previous and the current fragment,
flag the current (conflicting) fragment as FD_OVERLAPCONFLICT.  Do *not* flag
the fragment that got us into the reassembly routine (probably the final
fragment): it is not (may not be) the guilty fragment.

Clean up some spacing.

Also add reassembly tests for duplicate/retransmitted fragments.

svn path=/trunk/; revision=36131
2011-03-03 20:22:45 +00:00
Gerald Combs 3e13ddbadc Fix a few errors found by Clang scan-build.
svn path=/trunk/; revision=36002
2011-02-18 19:46:05 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +00:00
Bill Meier c65ef3a0c2 Rework some comments.
svn path=/trunk/; revision=35176
2010-12-11 04:11:31 +00:00
Bill Meier 0c5da97fb8 Fix bug #5477: fuzz-test failure found by using G_SLICE=debug-blocks.
Essentially: doing g_slice_free with the wrong 'type' for the data to be freed.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5477

svn path=/trunk/; revision=35175
2010-12-11 03:22:09 +00:00
Anders Broman 55fcebeaa8 Mark parameter as unused.
reassemble.c:220: warning: unused parameter 'key_arg'

svn path=/trunk/; revision=35156
2010-12-08 11:25:22 +00:00
Anders Broman 2b23f77b96 reassemble.c: In function 'free_all_fragments':
reassemble.c:222: warning: unused variable 'key'

svn path=/trunk/; revision=35155
2010-12-08 09:12:03 +00:00
Anders Broman c1bf80d555 fragment_free_key to be used only if Glib >= 2.10
svn path=/trunk/; revision=35154
2010-12-08 08:26:40 +00:00
Anders Broman 6125184241 Reassemble.c leaks memory for GLIB > 2.8
Free fragment data and fragment keys in fragment_table when neccessary. reassembled_table remains to be fixed.

svn path=/trunk/; revision=35153
2010-12-08 06:32:04 +00:00
Jeff Morriss e17b9ccec1 Rev 29427 added packet_add_new_data_source() with a comment indicating that
the data source does not need to be allocated if (!tree).

Rev 30158 took the if (!tree) check out indicating that the check was invalid.

So: (since packet_add_new_data_source() now only calls add_new_data_source()),
remove packet_add_new_data_source().

svn path=/trunk/; revision=34717
2010-10-30 16:00:30 +00:00
Stig Bjørlykke 46749e843c Use the name from hf_fragment instead of hf_fragments when we only have
one fragment to reassemble.

svn path=/trunk/; revision=34285
2010-09-30 09:53:51 +00:00
Stig Bjørlykke 79ec447f8b Put the number of fragments/segments in front of the element to avoid
conflict when they are named fragments instead of segments and to avoid
duplicating the fragments/segments text.

svn path=/trunk/; revision=34074
2010-09-07 20:40:39 +00:00
Stig Bjørlykke 1af02462fd From Yaniv Kaul via bug 4550:
Show number of segments which were used in the desgementation.

svn path=/trunk/; revision=34072
2010-09-07 14:06:43 +00:00
Jeff Morriss 64f5d56bba Fix reassemble_test's (copy of the) proto_tree_add_item() prototype to get it
compiling again.

fragment_add_seq_check(), fragment_add_seq_802_11(), and fragment_add_seq_next()
all call fragment_add_seq_check_work() so make their prototypes match each other
in const-ness.  This fixes a warning when compiling reassemble_test.

svn path=/trunk/; revision=32933
2010-05-24 15:13:02 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

 From me: Fix a number of instances where the function prototype or
  the function definition wasn't changed so there was a mismatch 
  thus causing Windows (but not gcc) compilation errors.

svn path=/trunk/; revision=32365
2010-04-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Stig Bjørlykke 88b72356ad Introduce "Reassembled length" filter element for all protocols doing
reassembly.

svn path=/trunk/; revision=31767
2010-02-02 16:01:52 +00:00
Gerald Combs 830ee22db4 Set a mem_chunk to NULL after we destroy it. This should fix the Solaris
buildbot test failures.

svn path=/trunk/; revision=30639
2009-10-20 15:43:40 +00:00
Jeff Morriss 8f8eb40e9b Make it actually work with glib < 2.10
svn path=/trunk/; revision=30621
2009-10-19 14:52:15 +00:00
Stig Bjørlykke f0cada596a Make it build on glib < 2.10.
svn path=/trunk/; revision=30607
2009-10-18 21:27:50 +00:00
Jeff Morriss ea7d2deaeb dcerpc_fragment_key_copy(): don't se_alloc() the key:
- it contains pointers to a couple malloc()'d addresses
	- it is inserted in the fragment table (the contents of which are
	  g_free()'d in free_all_fragments())

Instead, do like fragment_key_copy() and use a g_slice or g_chunk, depending
on the glib version.

svn path=/trunk/; revision=30599
2009-10-18 19:46:46 +00:00
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 7cb17ecec0 Use the slice allocator if GLIB >= 2,10,0
svn path=/trunk/; revision=29440
2009-08-16 04:54:33 +00:00
Kovarththanan Rajaratnam 7d44262406 This patch introduces packet_add_new_data_source() which effectively deprecates add_new_data_source(). This is based on the following observation:
1) The tvb + name (aka. data_source) is only used when the protocol tree is visible

The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify.

A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated!

svn path=/trunk/; revision=29427
2009-08-15 06:38:10 +00:00
Kovarththanan Rajaratnam 8fd6301ddc White space changes
svn path=/trunk/; revision=29397
2009-08-12 19:32:54 +00:00
Bill Meier 5aef94e6eb reassemble.h: update two comments; reassemble.c: correct a typo.
svn path=/trunk/; revision=29205
2009-07-27 13:59:53 +00:00
Gerald Combs 75e048491a Check for an overflow. This should hopefully fix bug 3672.
svn path=/trunk/; revision=29128
2009-07-16 22:25:06 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Bill Meier fd245e378f Reword comment a bit ...
svn path=/trunk/; revision=25345
2008-05-21 18:08:43 +00:00
Bill Meier bf018e2a96 Fix for bug #2470; (don't memcmp past end of g_malloc'd buffer).
svn path=/trunk/; revision=25343
2008-05-21 16:53:07 +00:00
Bill Meier 6ae1343094 Fix a few typos ....
svn path=/trunk/; revision=25253
2008-05-07 17:57:45 +00:00
Anders Broman 03c7a3c920 Apply yet another set of the optimization patches:
Use O(1) logic for the fast path when adding fragments (ie fragments are in order).

svn path=/trunk/; revision=23422
2007-11-10 16:08:14 +00:00
Stig Bjørlykke c6ba6d714d Added fragment_start_seq_check to start a reassembly without adding any data.
svn path=/trunk/; revision=22513
2007-08-15 22:24:05 +00:00
Graeme Lunt 2033b06cda Added a new function, fragment_end_seq_next(), to end the
fragmented data without adding an empty data fragment. 
This is used by the RTSE dissector which can't identify the 
last fragment until after it has been added.


svn path=/trunk/; revision=22174
2007-06-24 05:14:39 +00:00
Stephen Fisher 46b8669566 Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errors
under gcc to tools/lemon, plugins/mate and epan/


svn path=/trunk/; revision=21204
2007-03-26 06:10:52 +00:00
Anders Broman e2cab6caa9 From Richard van der Hoff:
01_reassemble_test.patch
------------------------
I didn't want to do anything without some unit tests, so here they are. 
This allows a standalone binary, epan/reassemble_test, to be built; this can be run from the commandline and should end up printing out "success" 
if all goes well.
NOTE the changes to makefile.am NOT checked in currently.

Incidentally: is it possible to get the buildbot to run things like this, exntest and tvbtest?

02_reassemble_refactor.patch
----------------------------
fragment_add_seq, fragment_add_dcerpc_dg and fragment_add_seq_check_work were all pretty much carbon-copies of each other. This patch factors out the common parts of the routines into a new routine, fragment_add_seq_key().

03_reassemble_partial_reassembly.patch
---------------------------------------
This makes fragment_set_partial_reassembly() work for datagrams assembled with fragment_add_seq(). The patch itself is actually quite small, but it adds another unit test which is reasonably lengthy.

svn path=/trunk/; revision=20888
2007-02-21 06:19:03 +00:00
Jeff Morriss 0787b688cc Squelch a few unused parameter warnings.
svn path=/trunk/; revision=20863
2007-02-19 15:30:06 +00:00
Jeff Morriss 1a9420702e Fix the SCCP dissector so it doesn't show non-segmented DT1 messages as
having been reassembled.

Fix the comments in reassembly.c and reassembly.h regarding what the reassembly
routines actually return in the 802.11 and no-sequence-number cases when they
are given the first and last packet (that is, a non-segmented packet): in
particular the routines return a pointer to a list containing just the one
fragment.

svn path=/trunk/; revision=20505
2007-01-19 23:27:24 +00:00
Guy Harris b343fcddd9 Fix pluralization of "bytes" so it doesn't say "1 bytes".
Clean up indentation.

svn path=/trunk/; revision=19953
2006-11-21 21:49:58 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping 17afca625c simply use DISSECTOR_ASSERT() to detect tvb problems instead of my previous commit
svn path=/trunk/; revision=17074
2006-01-22 19:31:42 +00:00
Ulf Lamping 4843257596 add fragment_get_reassembled_id so the handed id doesn't need to be a packet number (experimental)
add a check to fragment_add_common() if the given tvb parameters are ok, otherwise throw a DissectorError

add some more symbols to libethereal.def

svn path=/trunk/; revision=17073
2006-01-22 16:47:16 +00:00
Jaap Keuter 815a4af69e Hi All,
Find attached a couple of changes for t38:
- Use the dissector to reassemble t30 frames
- Dissect t30 protocol
- Move the "Fax t38 analysis" to the "VoIP Calls". Now when selecting
"Statistics"->"Fax t38 analysis" option, there is a message that
redirect the user to use the "Voip calls" instead. We may keep this
option for one release, and then remove it ?
- Added in the "Voip calls" the ability to detect a t38 call if there
are not signaling associated with it. For example, when using "Decode
as.." to dissect t38 packets, it is possible to use the "Voip calls" to                                                      analyze that call.
- Display "SDP (t38)" in the "Voip calls graph" for SDP t38 sessions.

Regards
Alejandro Vaquero


svn path=/trunk/; revision=17033
2006-01-15 15:01:14 +00:00
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