forked from wolfSSL/wolfssl
DTLS rx size check, ssn10
Allows for receiving datagrams larger than the MTU that are reassembled by the IP stack.
This commit is contained in:
13
src/ssl.c
13
src/ssl.c
@@ -88,6 +88,15 @@
|
||||
|
||||
#endif /* min */
|
||||
|
||||
#ifndef max
|
||||
|
||||
static INLINE word32 max(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
#ifndef CYASSL_LEANPSK
|
||||
char* mystrnstr(const char* s1, const char* s2, unsigned int n)
|
||||
@@ -440,6 +449,10 @@ static int CyaSSL_read_internal(CYASSL* ssl, void* data, int sz, int peek)
|
||||
#ifdef HAVE_ERRNO_H
|
||||
errno = 0;
|
||||
#endif
|
||||
#ifdef CYASSL_DTLS
|
||||
if (ssl->options.dtls)
|
||||
ssl->dtls_expected_rx = max(sz + 100, MAX_MTU);
|
||||
#endif
|
||||
|
||||
ret = ReceiveData(ssl, (byte*)data, min(sz, OUTPUT_RECORD_SIZE), peek);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user