diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-03-30 00:34:28 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-03-30 00:34:28 +0100 |
commit | 5b98dcf3a36f43bf335f6888d9515bdb614cbd6d (patch) | |
tree | 2b30439cc44a34bc86ddc265db68eab1e7f151b8 /ot_udp.c | |
parent | a3251ffac76ea1211d52b97ee232b8171a47c13d (diff) |
Limit ipv6 udp replies to an amount that does not create too large UDP packets. Credits to anonymous donor
Diffstat (limited to 'ot_udp.c')
-rw-r--r-- | ot_udp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -141,9 +141,9 @@ int handle_udp6( int64 serversocket, struct ot_workstruct *ws ) { | |||
141 | /* We do only want to know, if it is zero */ | 141 | /* We do only want to know, if it is zero */ |
142 | left = inpacket[64/4] | inpacket[68/4]; | 142 | left = inpacket[64/4] | inpacket[68/4]; |
143 | 143 | ||
144 | /* Limit amount of peers to 200 */ | 144 | /* Limit amount of peers to OT_MAX_PEERS_UDP */ |
145 | numwant = ntohl( inpacket[92/4] ); | 145 | numwant = ntohl( inpacket[92/4] ); |
146 | if (numwant > 200) numwant = 200; | 146 | if (numwant > OT_MAX_PEERS_UDP) numwant = OT_MAX_PEERS_UDP; |
147 | 147 | ||
148 | event = ntohl( inpacket[80/4] ); | 148 | event = ntohl( inpacket[80/4] ); |
149 | port = *(uint16_t*)( ((char*)inpacket) + 96 ); | 149 | port = *(uint16_t*)( ((char*)inpacket) + 96 ); |