summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-tcp.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-10-12 18:04:01 -0400
committerAnders Broman <a.broman58@gmail.com>2015-10-14 04:20:02 +0000
commit065c4646a631690896c9b45cadc4cc2d012255d8 (patch)
tree010bb42b30c6d0eecdd4403e3ad0f7c235475d0b /epan/dissectors/packet-tcp.c
parent66526f60c495a79a1d784caaca2c1f0d13bb7b11 (diff)
downloadwireshark-065c4646a631690896c9b45cadc4cc2d012255d8.tar.gz
TCP: only store up to 1000 unacked segments (in each direction).
If we're seeing only one side of a conversation (we're not seeing any ACKs) then things get really, really slow as the number of unacked segments grows. 1000 is, of course, an arbitrary limit. Bug: 11589 Change-Id: I42652965b736da50122c722e6ac386c4d481e57f Reviewed-on: https://code.wireshark.org/review/10971 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-tcp.c')
-rw-r--r--epan/dissectors/packet-tcp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 0adb5c7451..4bf940399c 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -1395,11 +1395,14 @@ finished_fwd:
finished_checking_retransmission_type:
nextseq = seq+seglen;
- if (seglen || flags&(TH_SYN|TH_FIN)) {
- /* add this new sequence number to the fwd list */
+ if ((seglen || flags&(TH_SYN|TH_FIN)) && tcpd->fwd->segment_count < TCP_MAX_UNACKED_SEGMENTS) {
+ /* Add this new sequence number to the fwd list. But only if there
+ * aren't "too many" unacked segements (e.g., we're not seeing the ACKs).
+ */
ual = wmem_new(wmem_file_scope(), tcp_unacked_t);
ual->next=tcpd->fwd->segments;
tcpd->fwd->segments=ual;
+ tcpd->fwd->segment_count++;
ual->frame=pinfo->fd->num;
ual->seq=seq;
ual->ts=pinfo->fd->abs_ts;
@@ -1502,6 +1505,7 @@ finished_checking_retransmission_type:
}
wmem_free(wmem_file_scope(), ual);
ual = tmpual;
+ tcpd->rev->segment_count--;
}
/* how many bytes of data are there in flight after this frame