Skip to content

Conversation

mrengineer7777
Copy link
Collaborator


Description of Change

Fixes corrupt log entry printed by SoftAP DHCPServer. Converts String() to expected cstr format.

I noticed while testing AP mode that the DHCP Server log prints random trash for the end of the IP address range. This is because a String is passed to a parameter expecting a cstr.

image

The relevant line is WiFiGeneric.cpp:154:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString(), IPAddress(lease.end_ip.addr).toString());

Should be:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString().c_str(), IPAddress(lease.end_ip.addr).toString().c_str());

I also searched the entirety of framework-arduinoespressif32 (PIO's copy of arduino-esp32) and verified that toString() is being used properly in all other files.

Tests scenarios

Tested fix on Adafruit Feather ESP32
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3/platform-espressif32-2.0.3.zip

Related links

No related issues

Fixes corrupt log entry printed by SoftAP DHCPServer.  Converts String() to expected cstr format.
@me-no-dev me-no-dev merged commit 14156d8 into espressif:master May 11, 2022
@me-no-dev
Copy link
Member

Thanks @mrengineer7777

@mrengineer7777 mrengineer7777 deleted the mrengineer7777-AP-DHCPServer-Log-Fix branch April 28, 2023 13:41
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.

2 participants