summaryrefslogtreecommitdiff
path: root/epan/follow.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2009-12-13 01:10:55 +0000
committerSake Blok <sake@euronet.nl>2009-12-13 01:10:55 +0000
commit1580d332f4fb4d218cb0fb1f6e8a306a302da7a4 (patch)
tree24b5d96ebdb98f00cc7f6362db93fa8a9a7015e7 /epan/follow.c
parente1ec979363c15c1da6a9b23f7278912cf729473a (diff)
downloadwireshark-1580d332f4fb4d218cb0fb1f6e8a306a302da7a4.tar.gz
Fix for bug 3955 and 4288. When doing Follow TCP stream, there was no
check whether a packet belonged to the correct tcp stream (when there are multiple streams in the tracefile with the samen ip addresses and tcp ports. svn path=/trunk/; revision=31252
Diffstat (limited to 'epan/follow.c')
-rw-r--r--epan/follow.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/follow.c b/epan/follow.c
index 604c25494b..be0817603d 100644
--- a/epan/follow.c
+++ b/epan/follow.c
@@ -56,6 +56,7 @@ FILE* data_out_file = NULL;
gboolean empty_tcp_stream;
gboolean incomplete_tcp_stream;
+static guint32 tcp_stream_to_follow;
static guint8 ip_address[2][MAX_IPADDR_LEN];
static guint port[2];
static guint bytes_written[2];
@@ -95,6 +96,7 @@ build_follow_filter( packet_info *pi ) {
buf = g_strdup_printf("tcp.stream eq %d", conv->index);
len = 4;
is_ipv6 = FALSE;
+ tcp_stream_to_follow = conv->index;
}
else if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
&& pi->ipproto == IP_PROTO_UDP ) {
@@ -115,6 +117,7 @@ build_follow_filter( packet_info *pi ) {
buf = g_strdup_printf("tcp.stream eq %d", conv->index);
len = 16;
is_ipv6 = TRUE;
+ tcp_stream_to_follow = conv->index;
}
else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6
&& pi->ipproto == IP_PROTO_UDP ) {
@@ -147,9 +150,9 @@ static guint8 src_addr[2][MAX_IPADDR_LEN];
static guint src_port[2] = { 0, 0 };
void
-reassemble_tcp( gulong sequence, gulong acknowledgement, gulong length,
- const char* data, gulong data_length, int synflag,
- address *net_src, address *net_dst,
+reassemble_tcp( guint32 tcp_stream, gulong sequence, gulong acknowledgement,
+ gulong length, const char* data, gulong data_length,
+ int synflag, address *net_src, address *net_dst,
guint srcport, guint dstport) {
guint8 srcx[MAX_IPADDR_LEN], dstx[MAX_IPADDR_LEN];
int src_index, j, first = 0, len;
@@ -160,6 +163,8 @@ reassemble_tcp( gulong sequence, gulong acknowledgement, gulong length,
src_index = -1;
/* First, check if this packet should be processed. */
+ if ( tcp_stream != tcp_stream_to_follow )
+ return;
if ((net_src->type != AT_IPv4 && net_src->type != AT_IPv6) ||
(net_dst->type != AT_IPv4 && net_dst->type != AT_IPv6))