diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c index d788ff2ffcda..e32faf95a0cf 100644 --- a/sys/netinet/sctp_cc_functions.c +++ b/sys/netinet/sctp_cc_functions.c @@ -1130,12 +1130,9 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt; unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT in msd for this calc */ - rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1144,10 +1141,11 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, * adjust the on-queue if our flight is more it could be that the * router has not yet gotten data "in-flight" to it */ - if (*on_queue < net->flight_size) + if (*on_queue < net->flight_size) { *on_queue = net->flight_size; - /* calculate the available space */ - bw_avail = (*bottle_bw * rtt) / 1000; + } + /* rtt is measured in micro seconds, bottle_bw in bytes per second */ + bw_avail = (uint32_t) (((uint64_t) (*bottle_bw) * net->rtt) / (uint64_t) 1000000); if (bw_avail > *bottle_bw) { /* * Cap the growth to no more than the bottle neck. This can @@ -1167,7 +1165,6 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, int seg_inflight, seg_onqueue, my_portion; net->partial_bytes_acked = 0; - /* how much are we over queue size? */ incr = *on_queue - bw_avail; if (stcb->asoc.seen_a_sack_this_pkt) {