From 4564749ccd258adf03f40f0a2f9173a3183a897a Mon Sep 17 00:00:00 2001 From: nnposter Date: Mon, 18 Jan 2021 20:11:40 +0000 Subject: [PATCH] Reject non-useable routes. Fixes #2206 --- CHANGELOG | 4 ++++ libnetutil/netutil.cc | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d6826a157..716f1e026 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ #Nmap Changelog ($Id$); -*-text-*- +o [GH#2206] Nmap no longer produces cryptic message "Failed to convert + source address to presentation format" when unable to find useable route + to the target. [nnposter] + o [Ncat][GH#2202] Use safety-checked versions of FD_* macros to abort early if number of connections exceeds FD_SETSIZE. [Pavel Zhukov] diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 5c265842b..1f61df4bc 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -3163,7 +3163,8 @@ static int route_dst_netlink(const struct sockaddr_storage *dst, len -= NLMSG_LENGTH(sizeof(*nlmsg)); /* See rtnetlink(7). Anything matching this route is actually unroutable. */ - if (rtmsg->rtm_type == RTN_UNREACHABLE) + if (rtmsg->rtm_type == RTN_UNREACHABLE || rtmsg->rtm_type == RTN_UNSPEC + || rtmsg->rtm_type == RTN_BLACKHOLE || rtmsg->rtm_type == RTN_PROHIBIT) return 0; /* Default values to be possibly overridden. */