aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-02-24 09:40:38 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-02-24 09:40:38 +0000
commitc47f73364b4c49335aa98def950dab6ace7c1f30 (patch)
tree314e08757664aade5811dfcf624a4e28c295bb2e
parent6da5fdfaf44fe09915fd60f853528a48f6e9a366 (diff)
with the cahnges to when to call the heuristic dissector
(and the fact that nbss does not register its conversation) this caused WANT_PDU_TRACKING to be decremented multiple times between the dissectors and thus ethereal could no longer reliably spot SMB PDUs that started in the middle of a tcp segment (unless we do reassembly which we dont do unless we have to since it eats soo many resources) FIX so that ethereal once again can spot SMB (and other) protocol PDUs that start in the middle of a segment. svn path=/trunk/; revision=10219
-rw-r--r--epan/packet.c4
-rw-r--r--packet-nbns.c13
-rw-r--r--packet-tcp.c26
3 files changed, 33 insertions, 10 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 7119a8b2a9..f132604781 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.101 2004/02/01 02:35:06 jmayer Exp $
+ * $Id: packet.c,v 1.102 2004/02/24 09:40:38 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -514,7 +514,6 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb,
}
pinfo->current_proto = saved_proto;
pinfo->can_desegment = saved_can_desegment;
- pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return ret;
}
@@ -1453,7 +1452,6 @@ dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
}
pinfo->current_proto = saved_proto;
pinfo->can_desegment=saved_can_desegment;
- pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return status;
}
diff --git a/packet-nbns.c b/packet-nbns.c
index 39ef694a19..42738184ac 100644
--- a/packet-nbns.c
+++ b/packet-nbns.c
@@ -3,7 +3,7 @@
* to when it had only NBNS)
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-nbns.c,v 1.82 2004/01/06 02:42:50 guy Exp $
+ * $Id: packet-nbns.c,v 1.83 2004/02/24 09:40:38 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1409,6 +1409,17 @@ dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo,
length += 65536;
}
+ /* give a hint to TCP where the next PDU starts
+ * so that it can attempt to find it in case it starts
+ * somewhere in the middle of a segment.
+ */
+ if(!pinfo->fd->flags.visited){
+ if((length+4)>tvb_reported_length_remaining(tvb, offset)){
+ pinfo->want_pdu_tracking=2;
+ pinfo->bytes_until_next_pdu=(length+4)-tvb_reported_length_remaining(tvb, offset);
+ }
+ }
+
/*
* Can we do reassembly?
*/
diff --git a/packet-tcp.c b/packet-tcp.c
index 52ef40d43f..76027cc839 100644
--- a/packet-tcp.c
+++ b/packet-tcp.c
@@ -1,7 +1,7 @@
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.221 2003/12/30 00:03:48 guy Exp $
+ * $Id: packet-tcp.c,v 1.222 2004/02/24 09:40:38 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2265,13 +2265,17 @@ decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* for the conversation if available */
if (try_conversation_dissector(&pinfo->src, &pinfo->dst, PT_TCP,
- src_port, dst_port, next_tvb, pinfo, tree))
+ src_port, dst_port, next_tvb, pinfo, tree)){
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
+ }
if (try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
- if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
+ if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)){
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
+ }
}
/* Do lookups with the subdissector table.
@@ -2297,20 +2301,28 @@ decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
high_port = dst_port;
}
if (low_port != 0 &&
- dissector_try_port(subdissector_table, low_port, next_tvb, pinfo, tree))
+ dissector_try_port(subdissector_table, low_port, next_tvb, pinfo, tree)){
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
+ }
if (high_port != 0 &&
- dissector_try_port(subdissector_table, high_port, next_tvb, pinfo, tree))
+ dissector_try_port(subdissector_table, high_port, next_tvb, pinfo, tree)){
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
+ }
if (!try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
- if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
+ if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)){
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
+ }
}
/* Oh, well, we don't know this; dissect it as data. */
call_dissector(data_handle,next_tvb, pinfo, tree);
+
+ pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return FALSE;
}
@@ -2319,6 +2331,8 @@ process_tcp_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo,
proto_tree *tree, proto_tree *tcp_tree, int src_port, int dst_port,
guint32 nxtseq, gboolean is_tcp_segment)
{
+ pinfo->want_pdu_tracking=0;
+
TRY {
if(is_tcp_segment){
/*qqq see if it is an unaligned PDU */