From 0580803b7d2c4de0533edc330ed30d36804b1df3 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 3 May 2022 19:38:20 +0200 Subject: [PATCH] Prevent Netgear SSDP from updating host (#71240) --- homeassistant/components/netgear/config_flow.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/netgear/config_flow.py b/homeassistant/components/netgear/config_flow.py index 85c206ce463..79053c712fc 100644 --- a/homeassistant/components/netgear/config_flow.py +++ b/homeassistant/components/netgear/config_flow.py @@ -19,6 +19,7 @@ from homeassistant.const import ( ) from homeassistant.core import callback from homeassistant.data_entry_flow import FlowResult +from homeassistant.util.network import is_ipv4_address from .const import ( CONF_CONSIDER_HOME, @@ -129,6 +130,9 @@ class NetgearFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): hostname = cast(str, hostname) updated_data[CONF_HOST] = hostname + if not is_ipv4_address(str(hostname)): + return self.async_abort(reason="not_ipv4_address") + _LOGGER.debug("Netgear ssdp discovery info: %s", discovery_info) await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_SERIAL])