summaryrefslogtreecommitdiff
path: root/epan/follow.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2011-07-17 11:08:02 +0000
committerSake Blok <sake@euronet.nl>2011-07-17 11:08:02 +0000
commit796564ed904e653d7395495dda593e9225a871b1 (patch)
tree3284dd032e2fa625a33d9e046b54fd25f1e55d6a /epan/follow.c
parent246d94edb2784581a467b5cf5c2bc4c1cae94d41 (diff)
downloadwireshark-796564ed904e653d7395495dda593e9225a871b1.tar.gz
Repair "Follow TCP Stream" which got broken by my change in SVN 38056
Mental note: Try to not do half work ;-) svn path=/trunk/; revision=38065
Diffstat (limited to 'epan/follow.c')
-rw-r--r--epan/follow.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/epan/follow.c b/epan/follow.c
index 83f2c4b4e1..05b0fdc89f 100644
--- a/epan/follow.c
+++ b/epan/follow.c
@@ -38,6 +38,7 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/ipproto.h>
+#include <epan/dissectors/packet-tcp.h>
#include "follow.h"
#include <epan/conversation.h>
@@ -87,16 +88,28 @@ build_follow_filter( packet_info *pi ) {
char* buf;
int len;
conversation_t *conv=NULL;
+ struct tcp_analysis *tcpd;
- if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
+ if( ((pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4) ||
+ (pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6))
&& 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("tcp.stream eq %d", conv->index);
- len = 4;
- is_ipv6 = FALSE;
- tcp_stream_to_follow = conv->index;
+ tcpd=get_tcp_conversation_data(conv, pi);
+ if (tcpd) {
+ buf = g_strdup_printf("tcp.stream eq %d", tcpd->stream);
+ tcp_stream_to_follow = tcpd->stream;
+ if (pi->net_src.type == AT_IPv4) {
+ len = 4;
+ is_ipv6 = FALSE;
+ } else {
+ len = 16;
+ is_ipv6 = TRUE;
+ }
+ } else {
+ return NULL;
+ }
}
else if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4
&& pi->ipproto == IP_PROTO_UDP ) {
@@ -110,16 +123,6 @@ 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
- && (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("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 ) {
/* UDP over IPv6 */
buf = g_strdup_printf(