mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-01 18:37:10 +03:00
Merge pull request #512 from mrdeep1/tcp_fixes
TCP: Prevent incorrectly formed PDUs causing RAM exhaustion.
This commit is contained in:
4 files changed
+36
-5
No files matched your search
@@ -63,7 +63,7 @@ typedef struct coap_session_t {
|
||||
coap_session_state_t state; /**< current state of relationaship with peer */
|
||||
unsigned ref; /**< reference count from queues */
|
||||
unsigned tls_overhead; /**< overhead of TLS layer */
|
||||
unsigned mtu; /**< path or CSM mtu */
|
||||
uint64_t mtu; /**< path or CSM mtu */
|
||||
coap_address_t local_if; /**< optional local interface address */
|
||||
UT_hash_handle hh;
|
||||
coap_addr_tuple_t addr_info; /**< key: remote/local address info */
|
||||
@@ -74,6 +74,7 @@ typedef struct coap_session_t {
|
||||
void *tls; /**< security parameters */
|
||||
uint16_t tx_mid; /**< the last message id that was used in this session */
|
||||
uint8_t con_active; /**< Active CON request sent */
|
||||
uint8_t csm_block_supported; /**< CSM TCP blocks supported */
|
||||
coap_tid_t last_ping_mid; /**< the last keepalive message id that was used in this session */
|
||||
struct coap_queue_t *delayqueue; /**< list of delayed messages waiting to be sent */
|
||||
size_t partial_write; /**< if > 0 indicates number of bytes already written from the pdu at the head of sendqueue */
|
||||
|
||||
+2
-2
@@ -45,10 +45,10 @@ struct coap_session_t;
|
||||
|
||||
#ifndef COAP_DEFAULT_MAX_PDU_RX_SIZE
|
||||
#if defined(WITH_CONTIKI) || defined(WITH_LWIP)
|
||||
#define COAP_DEFAULT_MAX_PDU_RX_SIZE (COAP_MAX_MESSAGE_SIZE_TCP16+4)
|
||||
#define COAP_DEFAULT_MAX_PDU_RX_SIZE (COAP_MAX_MESSAGE_SIZE_TCP16+4UL)
|
||||
#else
|
||||
/* 8 MiB max-message-size plus some space for options */
|
||||
#define COAP_DEFAULT_MAX_PDU_RX_SIZE (8*1024*1024+256)
|
||||
#define COAP_DEFAULT_MAX_PDU_RX_SIZE (8UL*1024*1024+256)
|
||||
#endif
|
||||
#endif /* COAP_DEFAULT_MAX_PDU_RX_SIZE */
|
||||
|
||||
|
||||
Reference in new issue
Block a user