Skip to content

Commit 7772034

Browse files
committed
fix: log type of duplicate message
1 parent b356bc8 commit 7772034

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/zeroconf/_core.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,22 @@ def datagram_received(
291291
v6_flow_scope = (flow, scope)
292292

293293
now = current_time_millis()
294+
if data_len < 12:
295+
log.debug(
296+
'Ignoring message from %r:%r [socket %s] (%d bytes) as too short',
297+
addr,
298+
port,
299+
self.sock_description,
300+
data_len,
301+
)
302+
return
303+
304+
type_ = _FLAGS_QR_RESPONSE if data[2] & _FLAGS_QR_RESPONSE else _FLAGS_QR_QUERY
294305
if self.suppress_duplicate_packet(data, now):
295306
# Guard against duplicate packets
296307
log.debug(
297-
'Ignoring duplicate message received from %r:%r [socket %s] (%d bytes) as [%r]',
308+
'Ignoring duplicate message with type %s received from %r:%r [socket %s] (%d bytes) as [%r]',
309+
"response" if type_ == _FLAGS_QR_RESPONSE else "query",
298310
addr,
299311
port,
300312
self.sock_description,

0 commit comments

Comments
 (0)