ICMP: Treat genuine ICMP diagnostic PDU for UDP as failure

Posix support only for unicast client requests.

ICMP disgnostic messages are ignored on server sessions.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2026-07-28 16:42:41 +01:00
1 parent f52fadaa9a
commit d4f78cd560
9 files changed
+200 -35

No files matched your search

+8
View File
@@ -21,6 +21,14 @@
extern "C" {
#endif
typedef struct coap_icmp_info_t {
uint32_t length;
uint8_t cmsg_level;
uint8_t ee_origin;
uint8_t ee_type;
uint8_t ee_code;
} coap_icmp_info_t;
/**
* @ingroup internal_api
* @defgroup dgrm Datagram (UDP) Support
+4
View File
@@ -260,6 +260,10 @@ struct coap_session_t {
coap_tick_t last_tx; /**< Last time a ratelimited packet is sent */
uint8_t is_rate_limiting; /**< Currently NON rate limiting */
uint32_t ping_failed; /**< Ping failure count */
#ifdef HAVE_LINUX_ERRQUEUE_H
coap_str_const_t *last_data_write; /**< Last sent data to check against ICMP
responses */
#endif /* HAVE_LINUX_ERRQUEUE_H */
};
#if COAP_SERVER_SUPPORT