Merge branch 'master' into 1.1
Conflicts: have.h lib/dropin.c lib/fake-getaddrinfo.c lib/pidfile.c src/Makefile.am src/bsd/device.c src/conf.c src/connection.c src/connection.h src/graph.c src/mingw/device.c src/net.c src/net_setup.c src/node.c src/protocol_key.c src/protocol_misc.c src/tincd.c
This commit is contained in:
commit
075e6828a7
43 changed files with 1094 additions and 306 deletions
|
|
@ -154,7 +154,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->buffer->output->off / (double)maxoutbufsize - 1 > drand48())
|
||||
if(2.0 * c->buffer->output->off / (float)maxoutbufsize - 1 > (float)rand()/(float)RAND_MAX)
|
||||
return true;
|
||||
|
||||
if(!send_request(c, "%d %hd", PACKET, packet->len))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue