diff options
author | 2016-01-19 09:51:30 +0200 | |
---|---|---|
committer | 2016-01-19 09:51:30 +0200 | |
commit | 8901340e51335d3b9e52e9f6851eeea6b6b2ed9d (patch) | |
tree | c9a420f01b9f7d880c013b2845952c22ccfdb18b | |
parent | 71a6450c40b0fdce63fbbb55bb15a4d2f9241ff5 (diff) |
In latency check, do not send responses for requests that were actually dropped
-rw-r--r-- | src/latency.cpp | 8 |
1 files 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; } |