Skip to content

Commit

Permalink
Improve 169.254.0.0/16 SSDP broadcast avoidance check (#264)
Browse files Browse the repository at this point in the history
It was unnecessarily using a regular expression, and in suspiciously
glob-style manner.

Co-authored-by: Oliver <[email protected]>
  • Loading branch information
scop and ol-iver authored Oct 7, 2023
1 parent 6b8884b commit 1a20188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion denonavr/ssdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def async_send_ssdp_broadcast() -> Set[str]:
async def async_send_ssdp_broadcast_ip(ip_addr: str) -> Set[str]:
"""Send SSDP broadcast messages to a single IP."""
# Ignore 169.254.0.0/16 addresses
if re.search("169.254.*.*", ip_addr):
if ip_addr.startswith("169.254."):
return set()

# Prepare socket
Expand Down

0 comments on commit 1a20188

Please sign in to comment.