validate NTP responses (fixes #3515)

* purge old (not yet processes) NTP responses
* validate server responses before updating WLED time
* purge receive buffer when package is rejected (avoids mem leak on esp32)
This commit is contained in:
Frank
2023-11-20 12:24:34 +01:00
parent 75f6a53269
commit 1e29d9463e
2 changed files with 28 additions and 2 deletions

View File

@@ -375,7 +375,8 @@
#define SUBPAGE_JS 254
#define SUBPAGE_WELCOME 255
#define NTP_PACKET_SIZE 48
#define NTP_PACKET_SIZE 48 // size of NTP recive buffer
#define NTP_MIN_PACKET_SIZE 48 // min expected size - NTP v4 allows for "extended information" appended to the standard fields
//maximum number of rendered LEDs - this does not have to match max. physical LEDs, e.g. if there are virtual busses
#ifndef MAX_LEDS