Bug 217558 - [security/nmap] [patch] make nmap compatible with INET4-only kernels
Summary: [security/nmap] [patch] make nmap compatible with INET4-only kernels
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Eugene Grosbein
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-05 09:48 UTC by Eugene Grosbein
Modified: 2017-05-19 09:51 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ohauer)


Attachments
check for errno==EAFNOSUPPORT (489 bytes, patch)
2017-03-05 09:48 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2017-03-05 09:48:53 UTC
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.
Comment 1 Eugene Grosbein 2017-03-05 09:54:37 UTC
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.
Comment 2 commit-hook freebsd_committer 2017-05-19 09:47:01 UTC
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
Comment 3 Eugene Grosbein freebsd_committer 2017-05-19 09:51:37 UTC
Take it as I've commited the patch.