Created attachment 180527 [details] check for errno==EAFNOSUPPORT Default build of nmap-7.40 package does not work for kernels build without INET6 support: # nmap -dd --iflist Starting Nmap 7.40 ( https://nmap.org ) at 2017-03-05 16:45 +07 Fetchfile found /usr/local/share/nmap/nmap-services PORTS: Using top 1000 ports found open (TCP:1000, UDP:0, SCTP:0) INTERFACES: NONE FOUND(!) Reason: getinterfaces_dnet: intf_open() failed ROUTES: NONE FOUND(!) Reason: getsysroutes_dnet: sysroutes_dnet_find_interfaces() failed One-line attached patch fixes this so mentioned command works for INET4-only kernel and also "nmap -sS" and others.
Also a comment: # Note: nmap does no longer build agains custom kernel without IPv6! in port's Makefile should be removed as it does build against custom kernel without IPv6. And works with supplied patch applied.
A commit references this bug: Author: eugen Date: Fri May 19 09:46:16 UTC 2017 New revision: 441214 URL: https://svnweb.freebsd.org/changeset/ports/441214 Log: Make nmap work with INET4-only kernels: - add new FreeBSD-specific patch; - remove invalid comment from Makefile (it did build but produced run-time error); - bump PORTREVISION. PR: 217558 Approved by: ohauer (maintainer timeout, 10 weeks), vsevolod (mentor) Changes: head/security/nmap/Makefile head/security/nmap/files/patch-intf.c
Take it as I've commited the patch.