aboutsummaryrefslogtreecommitdiffstats
path: root/follow.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-07-07 01:41:15 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-07-07 01:41:15 +0000
commitbe35348d2e6dc8f996c9de344ded516f054a501f (patch)
tree7c5350f877efd5a6887e5d7820dcd6827eb36185 /follow.c
parent02d98d84993d5194f17f38a2faa61bb6c9b118ed (diff)
From Jason Lango <jal@netapp.com>, a fix to a long-standing problem
(which could cause core dumps in "Follow TCP Stream") - "check_fragments()" was, when deleting a TCP segment at the beginning of the list of segments, setting "src[index]" to point to the next segment, not "frags[index]". "src[index]" is the source IP address, not a pointer to a fragment. Also, make some routines not used outside "follow.c" static. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@341 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'follow.c')
-rw-r--r--follow.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/follow.c b/follow.c
index 5e56cec3a3..006b62dd2a 100644
--- a/follow.c
+++ b/follow.c
@@ -1,6 +1,6 @@
/* follow.c
*
- * $Id: follow.c,v 1.8 1999/06/25 02:57:42 gram Exp $
+ * $Id: follow.c,v 1.9 1999/07/07 01:41:15 guy Exp $
*
* Copyright 1998 Mike Hall <mlh@io.com>
*
@@ -47,6 +47,9 @@ extern FILE* data_out_file;
gboolean incomplete_tcp_stream = FALSE;
+static int check_fragments( int );
+static void write_packet_data( const u_char *, int );
+
/* this will build libpcap filter text that will only
pass the packets related to the stream. There is a
chance that two streams could intersect, but not a
@@ -180,7 +183,7 @@ reassemble_tcp( u_long sequence, u_long length, const char* data, u_long data_le
/* here we search through all the frag we have collected to see if
one fits */
-int
+static int
check_fragments( int index ) {
tcp_frag *prev = NULL;
tcp_frag *current;
@@ -195,7 +198,7 @@ check_fragments( int index ) {
if( prev ) {
prev->next = current->next;
} else {
- src[index] = GPOINTER_TO_UINT(current->next);
+ frags[index] = current->next;
}
free( current->data );
free( current );
@@ -227,7 +230,7 @@ reset_tcp_reassembly() {
}
}
-void
+static void
write_packet_data( const u_char* data, int length ) {
fwrite( data, 1, length, data_out_file );
}