From 5b98dcf3a36f43bf335f6888d9515bdb614cbd6d Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 30 Mar 2024 00:34:28 +0100 Subject: Limit ipv6 udp replies to an amount that does not create too large UDP packets. Credits to anonymous donor --- trackerlogic.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'trackerlogic.h') diff --git a/trackerlogic.h b/trackerlogic.h index ef59179..f235de8 100644 --- a/trackerlogic.h +++ b/trackerlogic.h @@ -44,6 +44,13 @@ typedef struct { ot_ip6 address; int bits; } #define OT_CLIENT_REQUEST_INTERVAL_RANDOM ( OT_CLIENT_REQUEST_INTERVAL - OT_CLIENT_REQUEST_VARIATION/2 + (int)( nrand48(ws->rand48_state) % OT_CLIENT_REQUEST_VARIATION ) ) +/* List of peers should fit in a single UDP packet (around 1200 bytes) */ +#ifdef WANT_V6 +#define OT_MAX_PEERS_UDP 66 +#else +#define OT_MAX_PEERS_UDP 200 +#endif + /* If WANT_MODEST_FULLSCRAPES is on, ip addresses may not fullscrape more frequently than this amount in seconds */ #define OT_MODEST_PEER_TIMEOUT (60*5) -- cgit v1.2.3