summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2024-03-30 00:34:28 +0100
committerDirk Engling <erdgeist@erdgeist.org>2024-03-30 00:34:28 +0100
commit5b98dcf3a36f43bf335f6888d9515bdb614cbd6d (patch)
tree2b30439cc44a34bc86ddc265db68eab1e7f151b8 /trackerlogic.c
parenta3251ffac76ea1211d52b97ee232b8171a47c13d (diff)
Limit ipv6 udp replies to an amount that does not create too large UDP packets. Credits to anonymous donor
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 719f8a2..47e0085 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -259,8 +259,12 @@ static size_t return_peers_selection( struct ot_workstruct *ws, ot_peerlist *pee
259} 259}
260 260
261/* Compiles a list of random peers for a torrent 261/* Compiles a list of random peers for a torrent
262 * reply must have enough space to hold 92+6*amount bytes 262 * Reply must have enough space to hold:
263 * does not yet check not to return self 263 * 92 + 6 * amount bytes for TCP/IPv4
264 * 92 + 18 * amount bytes for TCP/IPv6
265 * 12 + 6 * amount bytes for UDP/IPv4
266 * 12 + 18 * amount bytes for UDP/IPv6
267 * Does not yet check not to return self
264*/ 268*/
265size_t return_peers_for_torrent( struct ot_workstruct * ws, ot_torrent *torrent, size_t amount, char *reply, PROTO_FLAG proto ) { 269size_t return_peers_for_torrent( struct ot_workstruct * ws, ot_torrent *torrent, size_t amount, char *reply, PROTO_FLAG proto ) {
266 ot_peerlist *peer_list = torrent->peer_list; 270 ot_peerlist *peer_list = torrent->peer_list;