socket: guard IPv6 code behind LWIP_IPV6 for ESP targets - #681
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add conditional compilation for IPv6 support in socket
socket: guard IPv6 code behind Jul 28, 2026
LWIP_IPV6 for ESP targets
|
✅Static analysis result - no issues found! ✅ |
finger563
marked this pull request as ready for review
July 28, 2026 16:29
finger563
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
CONFIG_LWIP_IPV6is disabled, lwIP does not definestruct sockaddr_in6. Declaringstruct sockaddr_in6 *ipv6_ptr()inside theesppnamespace causes the compiler to treatsockaddr_in6as a forward declaration ofespp::sockaddr_in6rather than the POSIX global, producing "incomplete type" errors on every member access.Changes
socket.hpp: Wrapipv6_ptr()andfrom_sockaddr(const struct sockaddr_in6&)declarations with#if !defined(ESP_PLATFORM) || LWIP_IPV6socket.cpp: Wrap the corresponding definitions —ipv6_ptr(), thePF_INET6branch inupdate(), andfrom_sockaddr(const struct sockaddr_in6&)— with the same guardThe guard
!defined(ESP_PLATFORM) || LWIP_IPV6preserves full IPv6 support on non-lwIP hosts (Linux/macOS/Windows) while excluding the broken code only when lwIP has IPv6 disabled.