mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix potential crash caused by packets with bogus ACK's.
Reported by: Fabien THOMAS <fabient@netasq.com>
This commit is contained in:
parent
4bde2ac539
commit
22dfb9bdb7
1 changed files with 2 additions and 1 deletions
|
|
@ -635,7 +635,7 @@ bad:
|
|||
struct ng_pptpgre_ackp *const a = &priv->ackp;
|
||||
const u_int32_t ack = ntohl(gre->data[gre->hasSeq]);
|
||||
const int index = ack - priv->recvAck - 1;
|
||||
const long sample = ng_pptpgre_time(node) - a->timeSent[index];
|
||||
long sample;
|
||||
long diff;
|
||||
|
||||
/* Sanity check ack value */
|
||||
|
|
@ -648,6 +648,7 @@ bad:
|
|||
priv->recvAck = ack;
|
||||
|
||||
/* Update adaptive timeout stuff */
|
||||
sample = ng_pptpgre_time(node) - a->timeSent[index];
|
||||
diff = sample - a->rtt;
|
||||
a->rtt += PPTP_ACK_ALPHA(diff);
|
||||
if (diff < 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue