Brief description
Since #5115 ("netbios: key the NBNS resolver cache by name"), calling nbns_resolve with a list of names fails in the cache lookup, because the list is used inside the cache key (qname, raw). Before #5115 the same call did not fail there: it went on to build the request from the list and pass it to sr1.
The type hint says qname: str, so a list may simply not be supported; if so, please close this. Reporting it because the behavior changed with the cache change, and scapy fields otherwise accept lists (one packet per value).
Scapy version
master at c5e9a5b (2026-09-26)
Python version
3.10
Operating system
Linux (Docker)
Additional environment information
No response
How to reproduce
from unittest import mock
from scapy.layers.netbios import nbns_resolve
with mock.patch("scapy.layers.netbios.conf.route.get_if_bcast", return_value=["192.0.2.255"]):
nbns_resolve(["ALPHA", "BETA"], iface="test")
Actual result
File ".../scapy/config.py", line 395, in __contains__
if not super(CacheInstance, self).__contains__(item):
TypeError: unhashable type: 'list'
Expected result
Either the pre-#5115 behavior, or a clear error saying that only a single name is accepted. (An empty list now fails the same way in the cache lookup; before #5115 it failed later, while sending.)
Related resources
#5115 (cc @KernelClint). Found by differential testing of recent pull requests and reproduced by hand on current master.
Brief description
Since #5115 ("netbios: key the NBNS resolver cache by name"), calling
nbns_resolvewith a list of names fails in the cache lookup, because the list is used inside the cache key(qname, raw). Before #5115 the same call did not fail there: it went on to build the request from the list and pass it tosr1.The type hint says
qname: str, so a list may simply not be supported; if so, please close this. Reporting it because the behavior changed with the cache change, and scapy fields otherwise accept lists (one packet per value).Scapy version
master at c5e9a5b (2026-09-26)
Python version
3.10
Operating system
Linux (Docker)
Additional environment information
No response
How to reproduce
Actual result
Expected result
Either the pre-#5115 behavior, or a clear error saying that only a single name is accepted. (An empty list now fails the same way in the cache lookup; before #5115 it failed later, while sending.)
Related resources
#5115 (cc @KernelClint). Found by differential testing of recent pull requests and reproduced by hand on current master.