Also do not use drand48(), it is not available on Windows.

This commit is contained in:
Guus Sliepen 2009-09-14 23:28:28 +02:00
parent 35e87b903e
commit f80bf14f28
2 changed files with 1 additions and 2 deletions

View file

@ -366,7 +366,6 @@ int main_loop(void)
last_graph_dump = now;
srand(now);
srand48(now);
running = true;

View file

@ -158,7 +158,7 @@ bool send_tcppacket(connection_t *c, vpn_packet_t *packet)
/* If there already is a lot of data in the outbuf buffer, discard this packet.
We use a very simple Random Early Drop algorithm. */
if(2.0 * c->outbuflen / (double)maxoutbufsize - 1 > drand48())
if(2.0 * c->outbuflen / (float)maxoutbufsize - 1 > (float)rand()/(float)RAND_MAX)
return true;
if(!send_request(c, "%d %hd", PACKET, packet->len))