mirror of
https://github.com/nmap/nmap.git
synced 2025-12-26 09:29:01 +00:00
A fix to r8309, this uses an error message already in nmap instead of the one I added
This commit is contained in:
@@ -521,11 +521,6 @@ do {
|
||||
if (rnfo.direct_connect) {
|
||||
hs->hostbatch[hidx]->setDirectlyConnected(true);
|
||||
} else {
|
||||
//if the user selected an interface with the -e command that has no route to their target
|
||||
//this error message will catch it.
|
||||
if(rnfo.nexthop.ss_family!=AF_INET || rnfo.nexthop.ss_family!=AF_INET6 ){
|
||||
fatal("%s: can not find route for non-directly conected device %s.", __func__, hs->hostbatch[hidx]->NameIP());
|
||||
}
|
||||
hs->hostbatch[hidx]->setDirectlyConnected(false);
|
||||
hs->hostbatch[hidx]->setNextHop(&rnfo.nexthop,
|
||||
sizeof(rnfo.nexthop));
|
||||
|
||||
10
tcpip.cc
10
tcpip.cc
@@ -3097,7 +3097,7 @@ bool route_dst(const struct sockaddr_storage *const dst, struct route_nfo *rnfo)
|
||||
/* Look up the device corresponding to src IP, if any ... */
|
||||
iface = getInterfaceByIP(&spoofss);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*o.device) {
|
||||
iface = getInterfaceByName(o.device);
|
||||
@@ -3124,10 +3124,14 @@ bool route_dst(const struct sockaddr_storage *const dst, struct route_nfo *rnfo)
|
||||
ifsin = (struct sockaddr_in *) &rnfo->nexthop;
|
||||
ifsin->sin_family = AF_INET;
|
||||
ifsin->sin_addr.s_addr = routes[i].gw.s_addr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
memcpy(&rnfo->ii, iface, sizeof(rnfo->ii));
|
||||
if(i == numroutes){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memcpy(&rnfo->ii, iface, sizeof(rnfo->ii));
|
||||
if (o.spoofsource)
|
||||
memcpy(&rnfo->srcaddr, &spoofss, sizeof(rnfo->srcaddr));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user