Small cleanup which addresses a warning regaring the truncation

of a 64-bit entity to a 32-bit entity. This issue was reported by
Peter Kasting from Google.

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2014-09-16 13:48:46 +00:00
parent 3220a2121c
commit 667eb48763

View File

@ -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) {