aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tcp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-12-09 00:12:38 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-12-09 00:12:38 +0000
commitd942d3129655d565692cebac646b32e3abf0fbcf (patch)
tree5fc23d11d86f02a4847c9b761e9c075b14bee043 /packet-tcp.c
parent65134a847690eaaf6563dc691d36112a6d58f514 (diff)
As per Didier Gautheron, dissect TCP options regardless of whether we're
building a protocol tree, so the Info column is set correctly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9214 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tcp.c')
-rw-r--r--packet-tcp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/packet-tcp.c b/packet-tcp.c
index bd555f15ed..200907ec9e 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.219 2003/11/19 09:32:04 sahlberg Exp $
+ * $Id: packet-tcp.c,v 1.220 2003/12/09 00:12:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2705,13 +2705,16 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Decode TCP options, if any. */
- if (tree && tcph->th_hlen > TCPH_MIN_LEN) {
+ if (tcph->th_hlen > TCPH_MIN_LEN) {
/* There's more than just the fixed-length header. Decode the
options. */
optlen = tcph->th_hlen - TCPH_MIN_LEN; /* length of options, in bytes */
- tf = proto_tree_add_text(tcp_tree, tvb, offset + 20, optlen,
- "Options: (%u bytes)", optlen);
- field_tree = proto_item_add_subtree(tf, ett_tcp_options);
+ if (tcp_tree != NULL) {
+ tf = proto_tree_add_text(tcp_tree, tvb, offset + 20, optlen,
+ "Options: (%u bytes)", optlen);
+ field_tree = proto_item_add_subtree(tf, ett_tcp_options);
+ } else
+ field_tree = NULL;
dissect_ip_tcp_options(tvb, offset + 20, optlen,
tcpopts, N_TCP_OPTS, TCPOPT_EOL, pinfo, field_tree);
}