mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 22:49:01 +00:00
This was previously gotten by setting the source address to be the same of the interface address of the matching route. However this can be wrong; when making a normal socket connection the source address is chosen differently. We create a SOCK_DGRAM socket, connect it, and read the local address with getsockname.