aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipv6.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-04-20 00:21:17 +0000
committerGuy Harris <guy@alum.mit.edu>2003-04-20 00:21:17 +0000
commitea29d0768a900d31a1a442695d5341b84dbc3654 (patch)
treeffb315e4068f77b3eed2e23ca544f72d27292b1e /packet-ipv6.c
parent0def9a0b52a6bbca03a55ea15759e8724dd2ac08 (diff)
Use "fragment_add_check()" for IPv6 and CLNP reassembly. (Possibly an
issue for CLNP, with its 16-bit IDs, which could be duplicated in a sufficiently large capture even if CLNP implementations don't deliberately reuse IDs; less of an issue for IPv6, with its 32-bit IDs and with its prohibition on reuse: For every packet that is to be fragmented, the source node generates an Identification value. The Identification must be different than that of any other fragmented packet sent recently* with the same Source Address and Destination Address. If a Routing header is present, the Destination Address of concern is that of the final destination. * "recently" means within the maximum likely lifetime of a packet, including transit time from source to destination and time spent awaiting reassembly with other fragments of the same packet. However, it is not required that a source node know the maximum packet lifetime. Rather, it is assumed that the requirement can be met by maintaining the Identification value as a simple, 32- bit, "wrap-around" counter, incremented each time a packet must be fragmented. It is an implementation choice whether to maintain a single counter for the node or multiple counters, e.g., one for each of the node's possible source addresses, or one for each active (source address, destination address) combination. but perhaps we'll ultimately be able to get rid of the old "fragment_add()" entirely and rename "fragment_add_check()" to "fragment_add()"). svn path=/trunk/; revision=7507
Diffstat (limited to 'packet-ipv6.c')
-rw-r--r--packet-ipv6.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c
index dad07e1a61..5df2e81233 100644
--- a/packet-ipv6.c
+++ b/packet-ipv6.c
@@ -1,7 +1,7 @@
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.94 2003/03/04 06:47:10 guy Exp $
+ * $Id: packet-ipv6.c,v 1.95 2003/04/20 00:21:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -106,6 +106,7 @@ static gboolean ipv6_reassemble = FALSE;
* defragmentation of IPv6
*/
static GHashTable *ipv6_fragment_table = NULL;
+static GHashTable *ipv6_reassembled_table = NULL;
void
capture_ipv6(const guchar *pd, int offset, int len, packet_counts *ld)
@@ -201,6 +202,7 @@ static void
ipv6_reassemble_init(void)
{
fragment_table_init(&ipv6_fragment_table);
+ reassembled_table_init(&ipv6_reassembled_table);
}
static int
@@ -636,8 +638,9 @@ again:
*/
save_fragmented = pinfo->fragmented;
if (ipv6_reassemble && frag && tvb_bytes_exist(tvb, offset, plen)) {
- ipfd_head = fragment_add(tvb, offset, pinfo, ident,
+ ipfd_head = fragment_add_check(tvb, offset, pinfo, ident,
ipv6_fragment_table,
+ ipv6_reassembled_table,
offlg & IP6F_OFF_MASK,
plen,
offlg & IP6F_MORE_FRAG);