aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tcp.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-24 09:40:38 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-24 09:40:38 +0000
commit7ad8039c1811efc6df6b515152985df4b7341bba (patch)
tree314e08757664aade5811dfcf624a4e28c295bb2e /packet-tcp.c
parentbbb4fcaac9f322120597f1421cac92f5bd369620 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10219 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tcp.c')
-rw-r--r--packet-tcp.c26
1 files changed, 20 insertions, 6 deletions
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 */