aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-09 00:12:38 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-09 00:12:38 +0000
commit5f003e39dbabdfb5f8f6f8d7d99203c8a2ea4153 (patch)
tree5fc23d11d86f02a4847c9b761e9c075b14bee043 /packet-tcp.c
parenta93463727e4fb892eab5898c1dad71ed030a1338 (diff)
downloadwireshark-5f003e39dbabdfb5f8f6f8d7d99203c8a2ea4153.tar.gz
wireshark-5f003e39dbabdfb5f8f6f8d7d99203c8a2ea4153.tar.bz2
wireshark-5f003e39dbabdfb5f8f6f8d7d99203c8a2ea4153.zip
As per Didier Gautheron, dissect TCP options regardless of whether we're
building a protocol tree, so the Info column is set correctly. svn path=/trunk/; revision=9214
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);
}