mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 00:19:01 +00:00
Add specifiers for source address and interface in route_dst_netlink.
We previously restricted by destination address; do it for source address as well. This can matter in some configurations. http://seclists.org/nmap-dev/2012/q3/831 There still seems to be a problem with the wrong route being chosen with --send-ip, but this patch is reported to work with --send-eth.
This commit is contained in:
@@ -3093,6 +3093,10 @@ static int route_dst_netlink(const struct sockaddr_storage *dst,
|
|||||||
|
|
||||||
/* Add rtattrs for destination address and interface. */
|
/* Add rtattrs for destination address and interface. */
|
||||||
add_rtattr_addr(nlmsg, &rtattr, &len, RTA_DST, dst);
|
add_rtattr_addr(nlmsg, &rtattr, &len, RTA_DST, dst);
|
||||||
|
if (spoofss != NULL) {
|
||||||
|
/* Add rtattrs for source address and interface. */
|
||||||
|
add_rtattr_addr(nlmsg, &rtattr, &len, RTA_SRC, spoofss);
|
||||||
|
}
|
||||||
|
|
||||||
iov.iov_base = nlmsg;
|
iov.iov_base = nlmsg;
|
||||||
iov.iov_len = nlmsg->nlmsg_len;
|
iov.iov_len = nlmsg->nlmsg_len;
|
||||||
|
|||||||
Reference in New Issue
Block a user