diff options
author | archie <archie@FreeBSD.org> | 2001-03-08 20:10:02 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2001-03-08 20:10:02 +0000 |
commit | 4010cd1c76927246d32483cd92a0c8cb0c42a159 (patch) | |
tree | b29d6ab1afc405504a6f3b404bf520797d80b476 /sys/netgraph | |
parent | 913a73686a6ddb969bcf6028a5577e494ace046f (diff) | |
download | FreeBSD-src-4010cd1c76927246d32483cd92a0c8cb0c42a159.zip FreeBSD-src-4010cd1c76927246d32483cd92a0c8cb0c42a159.tar.gz |
Fix potential crash caused by packets with bogus ACK's.
Reported by: Fabien THOMAS <fabient@netasq.com>
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_pptpgre.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c index a165a3a..c9a83ac 100644 --- a/sys/netgraph/ng_pptpgre.c +++ b/sys/netgraph/ng_pptpgre.c @@ -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) |