Skip to content

Commit e6a2804

Browse files
committed
Handle socket.IPV6_MULTICAST_IF failing to be set
1 parent ba4c943 commit e6a2804

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

wsdiscovery/threaded.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ def _createMulticastOutSocket(self, addr, ttl):
121121
else:
122122
iface = int(addr.scope_id)
123123

124-
sock.setsockopt(ip_proto, self._get_multicast(), iface)
124+
try:
125+
sock.setsockopt(ip_proto, self._get_multicast(), iface)
126+
except OSError as e:
127+
logger.warning(
128+
"Interface for %s does not support "
129+
"multicast flags or is not UP: OSError %s",
130+
addr,
131+
e
132+
)
125133

126134
return sock
127135

0 commit comments

Comments
 (0)