Skip to content

Commit 4564749

Browse files
author
nnposter
committed
Reject non-useable routes. Fixes nmap#2206
1 parent 5258ac6 commit 4564749

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#Nmap Changelog ($Id$); -*-text-*-
22

3+
o [GH#2206] Nmap no longer produces cryptic message "Failed to convert
4+
source address to presentation format" when unable to find useable route
5+
to the target. [nnposter]
6+
37
o [Ncat][GH#2202] Use safety-checked versions of FD_* macros to abort early if
48
number of connections exceeds FD_SETSIZE. [Pavel Zhukov]
59

libnetutil/netutil.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -3163,7 +3163,8 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
31633163
len -= NLMSG_LENGTH(sizeof(*nlmsg));
31643164

31653165
/* See rtnetlink(7). Anything matching this route is actually unroutable. */
3166-
if (rtmsg->rtm_type == RTN_UNREACHABLE)
3166+
if (rtmsg->rtm_type == RTN_UNREACHABLE || rtmsg->rtm_type == RTN_UNSPEC
3167+
|| rtmsg->rtm_type == RTN_BLACKHOLE || rtmsg->rtm_type == RTN_PROHIBIT)
31673168
return 0;
31683169

31693170
/* Default values to be possibly overridden. */

0 commit comments

Comments
 (0)