diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c index a165a3aac045..c9a83accd0a4 100644 --- a/sys/netgraph/ng_pptpgre.c +++ b/sys/netgraph/ng_pptpgre.c @@ -635,7 +635,7 @@ ng_pptpgre_recv(node_p node, item_p item) 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 @@ ng_pptpgre_recv(node_p node, item_p item) 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)