From 0fccd507434080c1b3df9d8cb6085298248ee561 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Wed, 10 Feb 2021 12:54:44 +0100 Subject: [PATCH] Fix crash on systemd with disabled ipv6 --- nmap.spec | 7 ++++++- nmap_resolve_config.patch | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 nmap_resolve_config.patch diff --git a/nmap.spec b/nmap.spec index 0427a9f..8afe58b 100644 --- a/nmap.spec +++ b/nmap.spec @@ -7,7 +7,7 @@ Name: nmap Epoch: 3 Version: 7.80 #global prerelease TEST5 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Network exploration tool and security scanner URL: http://nmap.org/ # Uses combination of licenses based on GPL license, but with extra modification @@ -31,6 +31,8 @@ Patch4: nmap-6.25-displayerror.patch # https://github.com/nmap/nmap/commit/33f421fd6e68fcb8ed50071661d9704717c81b2b.patch Patch5: nmap-unsolicited_arp_assert.patch Patch6: nmap-safe_fd_functions.patch +# https://github.com/nmap/nmap/pull/2247 +Patch7: nmap_resolve_config.patch BuildRequires: automake make @@ -143,6 +145,9 @@ ln -s ncat %{buildroot}%{_bindir}/nc %{_mandir}/man1/ncat.1.gz %changelog +* Wed Jan 13 2021 Pavel Zhukov - 3:7.80-10 +- Do not listen on ipv6 if it's disabled + * Tue Jan 26 2021 Fedora Release Engineering - 3:7.80-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/nmap_resolve_config.patch b/nmap_resolve_config.patch new file mode 100644 index 0000000..f1d2ecf --- /dev/null +++ b/nmap_resolve_config.patch @@ -0,0 +1,12 @@ +diff --git a/ncat/ncat_core.c b/ncat/ncat_core.c +index b76d5ea..9f0b0cf 100644 +--- a/ncat/ncat_core.c ++++ b/ncat/ncat_core.c +@@ -289,6 +289,7 @@ int resolve(const char *hostname, unsigned short port, + int result; + + flags = 0; ++ flags |= AI_ADDRCONFIG; + if (o.nodns) + flags |= AI_NUMERICHOST; +