Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IPADDR6_INIT() macro to set connecting IPv6 address #14

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

dwmw2
Copy link

@dwmw2 dwmw2 commented Sep 2, 2024

If LwIP is built with LWIP_IPV6_SCOPES, there is a 'zone' member in struct ip6_addr which was not being initialized correctly, leading to routing failures.

The tcp_connect() call would return ERR_RTE and we would completely fail to report that error. All the user would see is 'Connecting to MQTT...' over and over again.

If LwIP is built with LWIP_IPV6_SCOPES, there is a 'zone' member in
struct ip6_addr which was not being initialized correctly, leading to
routing failures.

The tcp_connect() call would return ERR_RTE and we would completely fail
to report that error. All the user would see is 'Connecting to MQTT...'
over and over again.
@mathieucarbou
Copy link

mathieucarbou commented Sep 2, 2024

@dwmw2 : I took the liberty to cherry-pick your fix in:

Copy link

@HeMan HeMan left a comment

Choose a reason for hiding this comment

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

Would the macro ip_addr_copy_from_ip6 give the same result? Otherwise, go with this.

@dwmw2
Copy link
Author

dwmw2 commented Sep 4, 2024

Would the macro ip_addr_copy_from_ip6 give the same result? Otherwise, go with this.

No, I don't think there's a simpler option.

All this converting between in_addr_t and various Arduino and ESPHome C++ classes is kind of awful :)

@HeMan
Copy link

HeMan commented Sep 4, 2024

Would the macro ip_addr_copy_from_ip6 give the same result? Otherwise, go with this.

No, I don't think there's a simpler option.

All this converting between in_addr_t and various Arduino and ESPHome C++ classes is kind of awful :)

Yeah, I was hoping that the helper class in ESPHome would fix it all...

@dwmw2
Copy link
Author

dwmw2 commented Sep 4, 2024

Would the macro ip_addr_copy_from_ip6 give the same result? Otherwise, go with this.

No, I don't think there's a simpler option.
All this converting between in_addr_t and various Arduino and ESPHome C++ classes is kind of awful :)

Yeah, I was hoping that the helper class in ESPHome would fix it all...

Yeah, that's part of my sadness. Its constructor which takes an arduino::IPAddress assumes it will be Legacy IP and converts via uint32_t... I'll take a look at that later.

After we merge this PR can we have a 2.1.4 release please? I'll then require it from esphome/esphome#7398

@HeMan
Copy link

HeMan commented Sep 5, 2024

@jesserockz ready for merge!

dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 5, 2024
@dwmw2
Copy link
Author

dwmw2 commented Sep 5, 2024

And v2.1.4 tag please

library.json Outdated Show resolved Hide resolved
@esphome esphome bot marked this pull request as draft September 5, 2024 08:24
@esphome
Copy link

esphome bot commented Sep 5, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@dwmw2 dwmw2 marked this pull request as ready for review September 5, 2024 08:30
@esphome esphome bot requested a review from jesserockz September 5, 2024 08:30
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 5, 2024
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 5, 2024
This depends on a soon-to-be-released version of LibreTiny containing
libretiny-eu/libretiny#292 which will have a version of at least 1.6.1.

Previous ESPHome PRs (esphome#7408, esphome#7409, esphome#7410) make it possible to require
at least LibreTiny version 1.6.1 in order to enable IPv6.

It also bumps the required AsyncTCP version to 2.1.4, which will include
esphome/AsyncTCP#14

Closes esphome/feature-requests#2853
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 6, 2024
@HeMan HeMan merged commit cd05918 into esphome:main Sep 6, 2024
2 checks passed
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 6, 2024
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 9, 2024
dwmw2 added a commit to dwmw2/esphome that referenced this pull request Sep 10, 2024
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.

4 participants