Skip to content

socket: guard IPv6 code behind LWIP_IPV6 for ESP targets - #681

Merged
finger563 merged 2 commits into
mainfrom
copilot/add-conditional-compilation-for-ipv6
Jul 28, 2026
Merged

socket: guard IPv6 code behind LWIP_IPV6 for ESP targets#681
finger563 merged 2 commits into
mainfrom
copilot/add-conditional-compilation-for-ipv6

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

When CONFIG_LWIP_IPV6 is disabled, lwIP does not define struct sockaddr_in6. Declaring struct sockaddr_in6 *ipv6_ptr() inside the espp namespace causes the compiler to treat sockaddr_in6 as a forward declaration of espp::sockaddr_in6 rather than the POSIX global, producing "incomplete type" errors on every member access.

Changes

  • socket.hpp: Wrap ipv6_ptr() and from_sockaddr(const struct sockaddr_in6&) declarations with #if !defined(ESP_PLATFORM) || LWIP_IPV6
  • socket.cpp: Wrap the corresponding definitions — ipv6_ptr(), the PF_INET6 branch in update(), and from_sockaddr(const struct sockaddr_in6&) — with the same guard

The guard !defined(ESP_PLATFORM) || LWIP_IPV6 preserves full IPv6 support on non-lwIP hosts (Linux/macOS/Windows) while excluding the broken code only when lwIP has IPv6 disabled.

Copilot AI review requested due to automatic review settings July 28, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI linked an issue Jul 28, 2026 that may be closed by this pull request
@finger563
finger563 requested a review from Copilot July 28, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Copilot AI review requested due to automatic review settings July 28, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Add conditional compilation for IPv6 support in socket socket: guard IPv6 code behind LWIP_IPV6 for ESP targets Jul 28, 2026
Copilot AI requested a review from finger563 July 28, 2026 15:49
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@finger563
finger563 marked this pull request as ready for review July 28, 2026 16:29
@finger563
finger563 merged commit dba90ca into main Jul 28, 2026
131 checks passed
@finger563
finger563 deleted the copilot/add-conditional-compilation-for-ipv6 branch July 28, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

espp/socket需要支持未启用IPv6的情形

3 participants