mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +00:00
Pass the dst argument to existing calls to nmap.ip_send.
This commit is contained in:
@@ -916,7 +916,7 @@ local function send_probe(scanner, probe)
|
||||
-- craft the raw packet
|
||||
local pkt = proto_vtable[probe.proto].getprobe(scanner.target, probe.portno, probe.ttl)
|
||||
|
||||
try(scanner.sock:ip_send(pkt.buf))
|
||||
try(scanner.sock:ip_send(pkt.buf, scanner.target))
|
||||
|
||||
-- update probe informations
|
||||
probe.retry = probe.retry + 1
|
||||
|
||||
@@ -221,7 +221,7 @@ action = function(host)
|
||||
local tcp = genericpkt(host, ipidseqport)
|
||||
|
||||
while i <= NUMPROBES do
|
||||
try(sock:ip_send(tcp.buf))
|
||||
try(sock:ip_send(tcp.buf, host))
|
||||
|
||||
local status, len, _, layer3 = pcap:pcap_receive()
|
||||
local test = bin.pack('AA=S=S', tcp.ip_bin_src, tcp.ip_bin_dst, tcp.tcp_sport, tcp.tcp_dport)
|
||||
|
||||
@@ -103,11 +103,11 @@ local function send_queries(host)
|
||||
dnet = nmap.new_dnet()
|
||||
dnet:ip_open()
|
||||
local p = build_ni_query(host.bin_ip_src, host.bin_ip, QTYPE_NODEADDRESSES)
|
||||
dnet:ip_send(p)
|
||||
dnet:ip_send(p, host)
|
||||
p = build_ni_query(host.bin_ip_src, host.bin_ip, QTYPE_NODENAME)
|
||||
dnet:ip_send(p)
|
||||
dnet:ip_send(p, host)
|
||||
p = build_ni_query(host.bin_ip_src, host.bin_ip, QTYPE_NODEIPV4ADDRESSES)
|
||||
dnet:ip_send(p)
|
||||
dnet:ip_send(p, host)
|
||||
dnet:ip_close()
|
||||
end
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ local mrinfoQuery = function(interface, dstip)
|
||||
sock:ethernet_close()
|
||||
else
|
||||
sock:ip_open()
|
||||
sock:ip_send(mrinfo_packet.buf)
|
||||
sock:ip_send(mrinfo_packet.buf, dstip)
|
||||
sock:ip_close()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -162,7 +162,7 @@ local traceSend = function(interface, destination, trace_raw)
|
||||
sock:ethernet_close()
|
||||
else
|
||||
sock:ip_open()
|
||||
sock:ip_send(trace_packet.buf)
|
||||
sock:ip_send(trace_packet.buf, destination)
|
||||
sock:ip_close()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -332,7 +332,7 @@ action = function(host)
|
||||
status = false
|
||||
while true do
|
||||
if not status then
|
||||
if not sock:ip_send(pkt.buf) then
|
||||
if not sock:ip_send(pkt.buf, host) then
|
||||
-- Got a send error, perhaps EMSGSIZE
|
||||
-- when we don't know our interface's
|
||||
-- MTU. Drop an MTU and keep trying.
|
||||
|
||||
@@ -444,7 +444,7 @@ action = function(host)
|
||||
|
||||
start = stdnse.clock_us()
|
||||
|
||||
try(sock:ip_send(tcp.buf))
|
||||
try(sock:ip_send(tcp.buf, host))
|
||||
|
||||
stats[j].sent = stats[j].sent + 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user