aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorsake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-08-29 15:27:20 +0000
committersake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-08-29 15:27:20 +0000
commit6ef9f9dc78bd8fac0ce9288e2226b8e9a7687eca (patch)
tree570e0a33800663a5c1dbf5a491e9697d663c4225 /epan
parentc7408c8e6477e57ea08734bac09478469cf67e4a (diff)
From Cal Turney (bug 5132):
TCP bytes_in flight becomes inflated with lost packets This patch suspends Bytes-in-Flight calculation when missing packets are detected. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33994 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-tcp.c11
-rw-r--r--epan/dissectors/packet-tcp.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 2061fbf394..12153611d3 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -283,6 +283,9 @@ init_tcp_conversation_data(packet_info *pinfo)
tcpd->ts_first.nsecs=pinfo->fd->abs_ts.nsecs;
tcpd->ts_prev.secs=pinfo->fd->abs_ts.secs;
tcpd->ts_prev.nsecs=pinfo->fd->abs_ts.nsecs;
+ tcpd->flow1.valid_bif = 1;
+ tcpd->flow2.valid_bif = 1;
+
return tcpd;
}
@@ -633,6 +636,9 @@ printf("REV list lastflags:0x%04x base_seq:0x%08x:\n",tcpd->rev->lastsegmentflag
tcpd->rev->base_seq = (flags & TH_SYN) ? ack : ack-1;
}
+ if( flags & TH_ACK ){
+ tcpd->rev->valid_bif = 1;
+ }
/* ZERO WINDOW PROBE
* it is a zero window probe if
@@ -680,6 +686,9 @@ printf("REV list lastflags:0x%04x base_seq:0x%08x:\n",tcpd->rev->lastsegmentflag
tcp_analyze_get_acked_struct(pinfo->fd->num, TRUE, tcpd);
}
tcpd->ta->flags|=TCP_A_LOST_PACKET;
+
+ /* Disable BiF until an ACK is seen in the other direction */
+ tcpd->fwd->valid_bif = 0;
}
@@ -986,7 +995,7 @@ finished_checking_retransmission_type:
* was sent
*/
ual=tcpd->fwd->segments;
- if (tcp_track_bytes_in_flight && seglen!=0 && ual) {
+ if (tcp_track_bytes_in_flight && seglen!=0 && ual && tcpd->fwd->valid_bif) {
guint32 first_seq, last_seq, in_flight;
first_seq = ual->seq - tcpd->fwd->base_seq;
diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h
index e61514ce51..fcbf313eac 100644
--- a/epan/dissectors/packet-tcp.h
+++ b/epan/dissectors/packet-tcp.h
@@ -155,6 +155,7 @@ typedef struct _tcp_flow_t {
gint16 win_scale; /* -1 is we dont know */
gint16 scps_capable; /* flow advertised scps capabilities */
guint16 maxsizeacked; /* 0 if not yet known */
+ gboolean valid_bif; /* if lost pkts, disable BiF until ACK is recvd */
/* This tcp flow/session contains only one single PDU and should
* be reassembled until the final FIN segment.