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
This commit is contained in:
Jeff Morriss 2007-01-19 23:27:24 +00:00
parent cb8d14bd5e
commit 1a9420702e
3 changed files with 24 additions and 30 deletions

View File

@ -1938,14 +1938,14 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH)
/* Reasemble */
if (!sccp_xudt_desegment){
if (!sccp_xudt_desegment) {
proto_tree_add_text(sccp_tree, tvb, variable_pointer1,
tvb_get_guint8(tvb, variable_pointer1)+1,
"Segmented Data");
dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
PARAMETER_DATA, variable_pointer1);
}else{
} else {
save_fragmented = pinfo->fragmented;
pinfo->fragmented = TRUE;
frag_msg = fragment_add_seq_next(tvb, variable_pointer1 + 1, pinfo,
@ -1960,13 +1960,13 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
&sccp_xudt_msg_frag_items, NULL,
tree);
if (frag_msg) { /* Reassembled */
if (frag_msg && frag_msg->next) { /* Reassembled */
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO,
" (Message Reassembled)");
} else { /* Not last packet of reassembled Short Message */
"(Message reassembled) ");
} else if (more) { /* Not last packet of reassembled message */
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment )");
col_append_str(pinfo->cinfo, COL_INFO, "(Message fragment) ");
}
pinfo->fragmented = save_fragmented;
@ -2201,11 +2201,11 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
if (frag_msg) { /* Reassembled */
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO,
" (Message Reassembled)");
} else { /* Not last packet of reassembled Short Message */
"(Message reassembled) ");
} else { /* Not last packet of reassembled message */
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO,
" (Message fragment )");
col_append_str(pinfo->cinfo, COL_INFO,
"(Message fragment) ");
}
pinfo->fragmented = save_fragmented;

View File

@ -1463,31 +1463,21 @@ fragment_add_dcerpc_dg(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id
* the fragment number.
*
* If this is the first fragment seen for this datagram, a new
* "fragment_data" structure is allocated to refer to the reassembled,
* packet, and:
* "fragment_data" structure is allocated to refer to the reassembled
* packet.
*
* if "more_frags" is false and "frag_802_11_hack" is true, the
* structure is not added to the hash table, and not given any
* fragments to refer to, but is just returned - this is a special
* hack for the 802.11 dissector (see packet-80211.c);
* This fragment is added to the linked list of fragments for this packet.
*
* otherwise, this fragment is added to the linked list of fragments
* for this packet, and the "fragment_data" structure is put into
* the hash table.
*
* Otherwise, this fragment is just added to the linked list of fragments
* for this packet.
* If "more_frags" is false and "frag_802_11_hack" (as the name implies,
* a special hack for 802.11) or "no_frag_number" (implying messages must be
* in order since there's no sequence number) are true, then this (one
* element) list is returned.
*
* If, after processing this fragment, we have all the fragments,
* "fragment_add_seq_check_work()" removes that from the fragment hash
* table if necessary and adds it to the table of reassembled fragments,
* and returns a pointer to the head of the fragment list.
*
* If this is the first fragment we've seen, and "more_frags" is false
* and "frag_802_11_hack" is true, "fragment_add_seq_check_work()" does
* nothing to the fragment data list, and returns a pointer to the head
* of that (empty) list.
*
* Otherwise, it returns NULL.
*
* XXX - Should we simply return NULL for zero-length fragments?

View File

@ -138,9 +138,13 @@ fragment_add_dcerpc_dg(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id
* head of the fragment list.
*
* If this is the first fragment we've seen, and "more_frags" is false,
* "fragment_add_seq_802_11()" does nothing to the fragment data list,
* and returns a pointer to the head of that (empty) list. The other
* routines return NULL.
* the fragment is added to the list. "fragment_add_seq_check()" will
* return NULL (waiting for the earlier sequence numbers) while
* "fragment_add_seq_802_11()" (a special hack for the 802.11 dissector) and
* "fragment_add_seq_next()" will return a pointer to the (one element) list.
* In this latter case reassembly wasn't done (since there was only one
* fragment in the packet); dissectors can check the 'next' pointer on the
* returned list to see if this case was hit or not.
*
* Otherwise, they return NULL.
*