esphome
aioesphomeapi
BlogDocsChangelog

Fix numeric-only hostnames being misinterpreted as IP addresses

#1438Merged
Comparing
swoboda1337:fix-numeric-hostname-resolution
(
29c7aab
) with
main
(
cf6d236
)
CodSpeed Performance Gauge
0%
Untouched
11

Benchmarks

Passed

test_raw_ble_plain_text_with_callback
tests/benchmarks/test_bluetooth.py
CodSpeed Performance Gauge
+3%
41.8 µs40.8 µs
test_noise_messages[128]
tests/benchmarks/test_noise.py
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
test_sending_light_command_request_with_bool
tests/benchmarks/test_requests.py
CodSpeed Performance Gauge
0%
48.4 µs48.3 µs
test_noise_messages[64]
tests/benchmarks/test_noise.py
CodSpeed Performance Gauge
0%
1.4 ms1.4 ms
test_noise_messages[16384]
tests/benchmarks/test_noise.py
CodSpeed Performance Gauge
0%
15 ms15 ms
test_noise_messages[0]
tests/benchmarks/test_noise.py
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
test_multiple_ble_adv_messages_single_read
tests/benchmarks/test_bluetooth.py
CodSpeed Performance Gauge
0%
28.8 µs28.8 µs
test_noise_messages[1024]
tests/benchmarks/test_noise.py
CodSpeed Performance Gauge
0%
1.9 ms1.9 ms
test_raw_ble_plain_text
tests/benchmarks/test_bluetooth.py
CodSpeed Performance Gauge
0%
23 µs23 µs
test_sending_empty_light_command_request
tests/benchmarks/test_requests.py
CodSpeed Performance Gauge
0%
44.7 µs44.8 µs
test_raw_ble_plain_text_different_advs
tests/benchmarks/test_bluetooth.py
CodSpeed Performance Gauge
0%
20.6 µs20.6 µs

Commits

Click on a commit to change the comparison range
Base
main
cf6d236
+0.31%
Fix numeric-only hostnames being misinterpreted as IP addresses When a hostname like "1234.local" has its .local suffix stripped for the getaddrinfo fallback, the resulting "1234" string gets interpreted by socket.getaddrinfo() as a decimal IP address (0.0.4.210 in this case). This caused OTA uploads to fail for devices with numeric-only names, as the connection would be attempted to the wrong IP address. The fix skips the stripped-hostname fallback when the hostname consists only of digits, as these will always be misinterpreted as IP addresses. Fixes esphome/esphome#12143 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29c7aab
2 days ago
by swoboda1337
© 2025 CodSpeed Technology
Home Terms Privacy Docs