Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLMNR] tolerate malformed queries/responses (#4381)
when showing summaries. Now that the question and answer sections are PacketListFields they can contain Raw instances without the qname/rrname attributes. This patch prevents `mysummary` from throwing the AttributeError exception when it encounters queries/responses like that. It's a follow-up to dda902e. Fixes: ``` File "scapy/scapy/sendrecv.py", line 1439, in tshark sniff(prn=_cb, store=False, *args, **kargs) File "scapy/scapy/sendrecv.py", line 1311, in sniff sniffer._run(*args, **kwargs) File "scapy/scapy/sendrecv.py", line 1254, in _run session.on_packet_received(p) File "scapy/scapy/sessions.py", line 109, in on_packet_received result = self.prn(pkt) File "scapy/scapy/sendrecv.py", line 1436, in _cb print("%5d\t%s" % (i[0], pkt.summary())) File "scapy/scapy/packet.py", line 1650, in summary return self._do_summary()[1] File "scapy/scapy/packet.py", line 1624, in _do_summary found, s, needed = self.payload._do_summary() File "scapy/scapy/packet.py", line 1624, in _do_summary found, s, needed = self.payload._do_summary() File "scapy/scapy/packet.py", line 1624, in _do_summary found, s, needed = self.payload._do_summary() File "scapy/scapy/packet.py", line 1627, in _do_summary ret = self.mysummary() File "scapy/scapy/layers/llmnr.py", line 60, in mysummary self.qd[0].qname.decode(errors="backslashreplace"), File "scapy/scapy/packet.py", line 469, in __getattr__ return self.payload.__getattr__(attr) File "scapy/scapy/packet.py", line 467, in __getattr__ fld, v = self.getfield_and_val(attr) File "scapy/scapy/packet.py", line 1793, in getfield_and_val raise AttributeError(attr) AttributeError: qname. Did you mean: '_name'? ```
- Loading branch information