Skip to content

Commit

Permalink
port: esp-idf: add ifndef for IN6_IS_ADDR_V4MAPPED(a)
Browse files Browse the repository at this point in the history
With ESP-IDF v5.4, LWIP was upgraded to v2.2.0. This includes a new
IN6_IS_ADDR_V4MAPPED(a) macro that is defined in lwip/inet.h. It conflicts
with the macro in Golioth's copy of the ESP-IDF port's coap_config_posix.h.

The macro is still present in ESP-IDF's coap_config_posix.h, so instead
of removal, the macro in Golioth's coap_config_posix.h is guarded with
ifndef.

Signed-off-by: Mike Szczys <[email protected]>
  • Loading branch information
szczys committed Jan 9, 2025
1 parent 5602b9a commit 40cb0fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions port/esp_idf/libcoap/include/coap_config_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ struct in6_pktinfo {
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
unsigned int ipi6_ifindex; /* send/recv interface index */
};

#ifndef IN6_IS_ADDR_V4MAPPED
#define IN6_IS_ADDR_V4MAPPED(a) \
((((__const uint32_t*)(a))[0] == 0) && (((__const uint32_t*)(a))[1] == 0) \
&& (((__const uint32_t*)(a))[2] == htonl(0xffff)))
#endif

/* As not defined, just need to define is as something innocuous */
#define IPV6_PKTINFO IPV6_CHECKSUM
Expand Down

0 comments on commit 40cb0fa

Please sign in to comment.