Skip to content

Conversation

@fleinze
Copy link
Contributor

@fleinze fleinze commented Sep 7, 2025

Description:

There is an issue with WiFiHelper::scrubDNS() where it saves invalid DNS-IPs (0.0.0.0). This is because the static cast from IPAddress to ip_addr_tdoes not work correctly in the current version of the esp-idf framework. This PR fixes this. Also fixes the underlying issue of #23874

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.1.3.250808
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@fleinze
Copy link
Contributor Author

fleinze commented Sep 8, 2025

I also had the issue of overwritten DNS servers with ipv4 only compiles, hence I added the extra ifdefs.
The DNS issue arises with dual ethernet and wifi ESPs, in my case it is a Zigbee-Gateway.
After startup the gateway gets an ethernet IP (and DNS) first with DHCP. Then Wifi starts and overwrites the DNS configuration. Any DNS requests that are made after Wifi startup and Wifi DHCP now fail. This happens with normal and IPV4-only builds. With the fixed scrubDNS() it works.

@eku
Copy link
Contributor

eku commented Sep 8, 2025

What's the relation between has_v6 and USE_IPV6? The code tests for has_v6 in branches outside USE_IPV6.

@Jason2866
Copy link
Collaborator

You have probably issues since trying to use Initialized 'tasmota-zbtest.local' Using mDNS extension .local is not supported with Tasmota. It does not work and creates issues.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 8, 2025

Yes, has_v6 outside of USE_IPV6 is always set false. I could edit it out but it should not matter in the final binary as modern compilers usually detect when an if condition is always true.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 8, 2025

@Jason2866 tasmota-zbtest is the hostname of the ESP32. I never made any config nor any #define regarding mDNS, I don't know why this ends up in the log.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 8, 2025

mDNS-log comes from support_network.ino:
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MDNS "%s '%s.local'"), (Mdns.begun) ? PSTR(D_INITIALIZED) : PSTR(D_FAILED), TasmotaGlobal.hostname);

@Jason2866
Copy link
Collaborator

Ahh, right. It is added for Matter.

@eku
Copy link
Contributor

eku commented Sep 9, 2025

Yes, has_v6 outside of USE_IPV6 is always set false. I could edit it out but it should not matter in the final binary as modern compilers usually detect when an if condition is always true.

To my understanding has_v6 should only exist if USE_IPV6 is defined and the test for its value should me moved inside USE_IPV6. That would make the code more readable.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 9, 2025

Ok, I will adjust my code accordingly.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 9, 2025

found a small error in the code, need to do another commit

@fleinze
Copy link
Contributor Author

fleinze commented Sep 9, 2025

Please review

@fleinze
Copy link
Contributor Author

fleinze commented Sep 11, 2025

You are right, this check is not needed if v6 is not compiled in. I changed the code to reflect this.

@fleinze
Copy link
Contributor Author

fleinze commented Sep 11, 2025

Can someone please restart the CI checks? It failed because of a dependency timeout, not because of the code change.

@fleinze fleinze requested a review from eku October 2, 2025 18:09
@github-actions
Copy link

This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Oct 27, 2025
@Jason2866 Jason2866 removed the stale Action - Issue left behind - Used by the BOT to call for attention label Oct 28, 2025
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.

3 participants