mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 04:09:01 +00:00
Pcap nsock sockets in NSE were cached so that multiple threads opening the "same" pcap descriptor (same device, bpf, promisc, snaplen) would get the same socket object. This is a leftover from a very old design that would multiplex captured packets to each thread, but for a long time that meant that each thread would just get whatever packets were available and miss any that another thread received. This almost never happened because scripts don't use identical pcap descriptors generally. But it did complicate garbage collection, resulting in segfaults and assertion failures in certain scenarios such as double-closing a socket.
33 KiB
33 KiB