diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-04-03 07:48:55 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-04-03 07:48:55 +0000 |
commit | a7f8fde347a233a0964b079d408275baa2739fed (patch) | |
tree | 1a87c88bbce95421ca908b31de69426393095c4a /packet-ldap.c | |
parent | b66e505b355aed04520bafcb5ba1773f674ee12f (diff) |
Improvements from Doug Nazar.
One of those improvements adds an "exit now" after we've filled in the
protocol and info columns if we're not building a protocol tree,
obviating the need for the "parse only the first request in the sequence
if we're not building a protocol tree" code I stuck in, so remove the
latter code.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1775 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ldap.c')
-rw-r--r-- | packet-ldap.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/packet-ldap.c b/packet-ldap.c index a510a17605..7ebfc9e61e 100644 --- a/packet-ldap.c +++ b/packet-ldap.c @@ -1,7 +1,7 @@ /* packet-ldap.c * Routines for ldap packet dissection * - * $Id: packet-ldap.c,v 1.5 2000/03/31 10:22:24 guy Exp $ + * $Id: packet-ldap.c,v 1.6 2000/04/03 07:48:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -725,15 +725,15 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) message_start = a.pointer - a.begin; if (read_sequence(&a, &messageLength)) { - if (tree) - proto_tree_add_text(tree, offset, 1, "Invalid LDAP packet"); + if (ldap_tree) + proto_tree_add_text(ldap_tree, offset, 1, "Invalid LDAP packet"); break; } if (messageLength > (a.end - a.pointer)) { - if (tree) - proto_tree_add_text(tree, message_start, END_OF_FRAME, "Short message! (expected: %u, actual: %u)", + if (ldap_tree) + proto_tree_add_text(ldap_tree, message_start, END_OF_FRAME, "Short message! (expected: %u, actual: %u)", messageLength, a.end - a.pointer); break; } @@ -758,9 +758,11 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_fstr(fd, COL_INFO, "MsgId=%u MsgType=%s", messageId, typestr); first_time = 0; + if (!tree) + return; } - if (tree) + if (ldap_tree) { proto_tree_add_item_hidden(ldap_tree, hf_ldap_message_id, message_id_start, message_id_length, messageId); proto_tree_add_item_hidden(ldap_tree, hf_ldap_message_type, @@ -814,12 +816,6 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) break; } } - else - { - /* Only parse the first request in the sequence if we're not building - a protocol tree. */ - break; - } } } |