From 8901340e51335d3b9e52e9f6851eeea6b6b2ed9d Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Tue, 19 Jan 2016 09:51:30 +0200 Subject: In latency check, do not send responses for requests that were actually dropped --- src/latency.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/latency.cpp b/src/latency.cpp index b213690f..e3a872e0 100644 --- a/src/latency.cpp +++ b/src/latency.cpp @@ -1003,9 +1003,11 @@ bool CLatencyPktModeICMP::IsLatencyPkt(IPHeader *ip) { void CLatencyPktModeICMP::update_recv(uint8_t *pkt, uint16_t *r_seq, uint16_t *t_seq) { ICMPHeader *m_icmp = (ICMPHeader *)(pkt); *r_seq = m_icmp->getSeqNum(); - // handle wrap around, so can_send_packet will allow us to send - if (*r_seq == 0) - *t_seq = 0; + // Previously, we assumed we can send for sequences smaller than r_seq. + // Actually, if the DUT (firewall) dropped an ICMP request, we should not send response for the dropped packet. + // We are only sure that we can send reqponse for the request we just got. + // This should be OK, since we send requests and responses in the same rate. + *t_seq = *r_seq; } -- cgit