projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
If PMTUDiscovery is not set, do not forward packets via TCP unnecessarily.
[tinc]
/
src
/
protocol_misc.c
diff --git
a/src/protocol_misc.c
b/src/protocol_misc.c
index
52e97e5
..
8f56aee
100644
(file)
--- a/
src/protocol_misc.c
+++ b/
src/protocol_misc.c
@@
-155,9
+155,10
@@
bool send_tcppacket(connection_t *c, vpn_packet_t *packet)
{
cp();
{
cp();
- /* If there already is a lot of data in the outbuf buffer, discard this 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(
c->outbuflen > maxoutbufsize
)
+ if(
2.0 * c->outbuflen / (double)maxoutbufsize - 1 > drand48()
)
return true;
if(!send_request(c, "%d %hd", PACKET, packet->len))
return true;
if(!send_request(c, "%d %hd", PACKET, packet->len))