[socket] Fix set_sockaddr() accepting malformed IPv4 addresses (#19394)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
rwrozelle
2026-09-18 18:10:11 -05:00
committed by GitHub
co-authored by Claude Sonnet 5
parent a53efcf646
commit f94661561d
4 changed files with 167 additions and 13 deletions
+16
View File
@@ -0,0 +1,16 @@
# This file's presence makes pytest treat this directory as a package named "socket",
# shadowing the stdlib module -- no test_*.py (Python-level) tests can live here.
# required for cpp unit testing.
import esphome.codegen as cg
from tests.testing_helpers import ComponentManifestOverride
def override_manifest(manifest: ComponentManifestOverride) -> None:
manifest.enable_codegen()
real_to_code = manifest.to_code
async def to_code_testing(config):
await real_to_code(config)
cg.add_define("USE_NETWORK_IPV6", True)
manifest.to_code = to_code_testing