From e6a2804e0c30fffc414ed1b99afeb0ce3ea999b1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 23 Jan 2025 22:18:49 -1000 Subject: [PATCH] Handle socket.IPV6_MULTICAST_IF failing to be set --- wsdiscovery/threaded.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wsdiscovery/threaded.py b/wsdiscovery/threaded.py index 0b309e5..b33de81 100644 --- a/wsdiscovery/threaded.py +++ b/wsdiscovery/threaded.py @@ -121,7 +121,15 @@ def _createMulticastOutSocket(self, addr, ttl): else: iface = int(addr.scope_id) - sock.setsockopt(ip_proto, self._get_multicast(), iface) + try: + sock.setsockopt(ip_proto, self._get_multicast(), iface) + except OSError as e: + logger.warning( + "Interface for %s does not support " + "multicast flags or is not UP: OSError %s", + addr, + e + ) return sock