aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ncp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-17 04:00:36 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-17 04:00:36 +0000
commitfa49e7601c5ac91a64fab3f8cf545c6069af2c3b (patch)
treee97a6d5ec57cc546113a6f7c3170bb83af25afdf /packet-ncp.c
parentb84de4724f63515d0f65de44a30aee0b2cc2015f (diff)
Don't rely on the "tree" argument being null as an indication that this
is the first time we've looked at a packet; it may not be null if, for example, we're doing read filtering, or if we're colorizing packets, or if there are plugins active, or if this is Tethereal with the "-V" flag. Instead, use the new "visited" flag. svn path=/trunk/; revision=1876
Diffstat (limited to 'packet-ncp.c')
-rw-r--r--packet-ncp.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/packet-ncp.c b/packet-ncp.c
index 907e7854e7..d0c85c7f35 100644
--- a/packet-ncp.c
+++ b/packet-ncp.c
@@ -3,7 +3,7 @@
* Gilbert Ramirez <gram@xiexie.org>
* Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net>
*
- * $Id: packet-ncp.c,v 1.32 2000/04/08 07:07:30 guy Exp $
+ * $Id: packet-ncp.c,v 1.33 2000/04/17 04:00:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -654,6 +654,26 @@ dissect_ncp_request(const u_char *pd, int offset, frame_data *fd,
}
}
+ if (!fd->flags.visited) {
+ /* This is the first time we've looked at this packet.
+ Remember the request, so we can find it if we later
+ a reply to it. */
+ request_key = g_mem_chunk_alloc(ncp_request_keys);
+ request_key->nw_server_address = nw_server_address;
+ request_key->nw_connection = nw_connection;
+ request_key->nw_sequence = nw_sequence;
+
+ request_val = g_mem_chunk_alloc(ncp_request_records);
+ request_val->ncp_type = nw_ncp_type;
+ request_val->ncp_record = ncp2222_find(request.function, request.subfunc);
+
+ g_hash_table_insert(ncp_request_hash, request_key, request_val);
+ #if defined(DEBUG_NCP_HASH)
+ printf("Inserted server %08X connection %d sequence %d (val=%08X)\n",
+ nw_server_address, nw_connection, nw_sequence, request_val);
+ #endif
+ }
+
if (ncp_tree) {
proto_tree_add_text(ncp_tree, offset+6, 1,
"Function Code: 0x%02X (%s)",
@@ -681,23 +701,6 @@ dissect_ncp_request(const u_char *pd, int offset, frame_data *fd,
}
}
}
- else { /* ! tree */
- request_key = g_mem_chunk_alloc(ncp_request_keys);
- request_key->nw_server_address = nw_server_address;
- request_key->nw_connection = nw_connection;
- request_key->nw_sequence = nw_sequence;
-
- request_val = g_mem_chunk_alloc(ncp_request_records);
- request_val->ncp_type = nw_ncp_type;
- request_val->ncp_record = ncp2222_find(request.function, request.subfunc);
-
- g_hash_table_insert(ncp_request_hash, request_key, request_val);
- #if defined(DEBUG_NCP_HASH)
- printf("Inserted server %08X connection %d sequence %d (val=%08X)\n",
- nw_server_address, nw_connection, nw_sequence, request_val);
- #endif
- }
-
}
void