1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-01 02:59:01 +00:00

Documenting an earlier change and adding a new, related one:

o Nsock now supports binding to a local address and setting IPv4 options
  with nsi_set_localaddr() and nsi_set_ipoptions(), respectively. [Kris]

o Nmap's Nsock-utilizing subsystems (DNS, NSE, version detection) have been
  updated to support the -S and --ip-options flags. [Kris]
This commit is contained in:
kris
2008-07-14 19:52:31 +00:00
parent 205ffa2274
commit ffb3d8202d
5 changed files with 36 additions and 3 deletions

View File

@@ -1766,6 +1766,12 @@ static void startNextProbe(nsock_pool nsp, nsock_iod nsi, ServiceGroup *SG,
if ((svc->niod = nsi_new(nsp, svc)) == NULL) {
fatal("Failed to allocate Nsock I/O descriptor in %s()", __func__);
}
if (o.spoofsource) {
o.SourceSockAddr(&ss, &ss_len);
nsi_set_localaddr(svc->niod, &ss, ss_len);
}
if (o.ipoptionslen)
nsi_set_ipoptions(svc->niod, o.ipoptions, o.ipoptionslen);
svc->target->TargetSockAddr(&ss, &ss_len);
if (svc->tunnel == SERVICE_TUNNEL_NONE) {
nsock_connect_tcp(nsp, svc->niod, servicescan_connect_handler,
@@ -1964,6 +1970,12 @@ static int launchSomeServiceProbes(nsock_pool nsp, ServiceGroup *SG) {
if (o.debugging > 1) {
log_write(LOG_PLAIN, "Starting probes against new service: %s:%hi (%s)\n", svc->target->targetipstr(), svc->portno, proto2ascii(svc->proto));
}
if (o.spoofsource) {
o.SourceSockAddr(&ss, &ss_len);
nsi_set_localaddr(svc->niod, &ss, ss_len);
}
if (o.ipoptionslen)
nsi_set_ipoptions(svc->niod, o.ipoptions, o.ipoptionslen);
svc->target->TargetSockAddr(&ss, &ss_len);
if (svc->proto == IPPROTO_TCP)
nsock_connect_tcp(nsp, svc->niod, servicescan_connect_handler,