Skip to content

Commit af12a2f

Browse files
committed
Handle duplicate removes
1 parent 1247acd commit af12a2f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

zeroconf/_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None:
331331
updates: List[RecordUpdate] = []
332332
address_adds: List[DNSAddress] = []
333333
other_adds: List[DNSRecord] = []
334-
removes: List[DNSRecord] = []
334+
removes: Set[DNSRecord] = set()
335335
now = msg.now
336336
unique_types: Set[Tuple[str, int, int]] = set()
337337

@@ -355,7 +355,7 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None:
355355
# expired and exists in the cache
356356
elif maybe_entry is not None:
357357
updates.append(RecordUpdate(record, maybe_entry))
358-
removes.append(record)
358+
removes.add(record)
359359

360360
if unique_types:
361361
self._async_mark_unique_cached_records_older_than_1s_to_expire(unique_types, msg.answers, now)

zeroconf/_utils/net.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ def add_multicast_member(
291291
interface,
292292
)
293293
return False
294+
if is_v6 and _errno == errno.ENODEV:
295+
log.info(
296+
'Address in use when adding %s to multicast group, '
297+
'it is expected to happen when the device does not have ipv6',
298+
interface,
299+
)
300+
return False
294301
raise
295302
return True
296303

0 commit comments

Comments
 (0)