File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments