aboutsummaryrefslogtreecommitdiffstats
path: root/epan/follow.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2008-09-30 13:29:15 +0000
committerSake Blok <sake@euronet.nl>2008-09-30 13:29:15 +0000
commitec20a1ccb810bb89b415805ebe6c47b9304cec7a (patch)
treee3140fabb3e0cb6e16e147980532e70951413979 /epan/follow.c
parenta550fb9d78fd141019fdbede43134ed6951bd380 (diff)
downloadwireshark-ec20a1ccb810bb89b415805ebe6c47b9304cec7a.tar.gz
wireshark-ec20a1ccb810bb89b415805ebe6c47b9304cec7a.tar.bz2
wireshark-ec20a1ccb810bb89b415805ebe6c47b9304cec7a.zip
Fix for bug 1447: Follow TCP Stream show only the first stream
Use the new "tcp.stream eq XXX" as a display filter for follow tcp stream. This makes sure only the tcp stream which the selected packet belangs to will be shown (in case tcp ports are reused in the tracefile). svn path=/trunk/; revision=26306
Diffstat (limited to 'epan/follow.c')
-rw-r--r--epan/follow.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/epan/follow.c b/epan/follow.c
index 64a063aa25..749d039600 100644
--- a/epan/follow.c
+++ b/epan/follow.c
@@ -39,6 +39,7 @@
#include <epan/packet.h>
#include <epan/ipproto.h>
#include "follow.h"
+#include <epan/conversation.h>
#define MAX_IPADDR_LEN 16
@@ -84,14 +85,14 @@ char*
build_follow_filter( packet_info *pi ) {
char* buf;
int len;
+ conversation_t *conv=NULL;
+
if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
- && pi->ipproto == IP_PROTO_TCP ) {
+ && pi->ipproto == IP_PROTO_TCP
+ && (conv=find_conversation(pi->fd->num, &pi->src, &pi->dst, pi->ptype,
+ pi->srcport, pi->destport, 0)) != NULL ) {
/* TCP over IPv4 */
- buf = g_strdup_printf(
- "(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
- ip_to_str( pi->net_src.data),
- ip_to_str( pi->net_dst.data),
- pi->srcport, pi->destport );
+ buf = g_strdup_printf("tcp.stream eq %d", conv->index);
len = 4;
is_ipv6 = FALSE;
}
@@ -107,13 +108,11 @@ build_follow_filter( packet_info *pi ) {
is_ipv6 = FALSE;
}
else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6
- && pi->ipproto == IP_PROTO_TCP ) {
+ && pi->ipproto == IP_PROTO_TCP
+ && (conv=find_conversation(pi->fd->num, &pi->src, &pi->dst, pi->ptype,
+ pi->srcport, pi->destport, 0)) != NULL ) {
/* TCP over IPv6 */
- buf = g_strdup_printf(
- "(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
- ip6_to_str((const struct e_in6_addr *)pi->net_src.data),
- ip6_to_str((const struct e_in6_addr *)pi->net_dst.data),
- pi->srcport, pi->destport );
+ buf = g_strdup_printf("tcp.stream eq %d", conv->index);
len = 16;
is_ipv6 = TRUE;
}