mirror of
https://github.com/nmap/nmap.git
synced 2026-09-27 02:29:42 +00:00
Use the same endianness for IP ID and DHCP transaction ID
This commit is contained in:
parent
e73041f34b
commit
35b543b291
1 changed files with 2 additions and 2 deletions
|
|
@ -147,7 +147,7 @@ local function dhcp_listener(sock, iface, macaddr, timeout, xid, result)
|
|||
-- Create a frame and add the IP header
|
||||
local frame = packet.Frame:new()
|
||||
frame:build_ip_packet(srcip, dstip, pkt, nil, --dsf
|
||||
string.unpack("<I2", xid), -- IPID, use 16 lsb of xid
|
||||
string.unpack(">I2", xid, 3), -- IPID, use 16 lsb of xid
|
||||
nil, nil, nil, -- flags, offset, ttl
|
||||
packet.IPPROTO_UDP)
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ action = function()
|
|||
-- start a listening thread for each interface
|
||||
for iface, _ in pairs(interfaces) do
|
||||
transaction_id = transaction_id + 1
|
||||
local xid = string.pack("<I4", transaction_id)
|
||||
local xid = string.pack(">I4", transaction_id)
|
||||
|
||||
local sock, co
|
||||
sock = nmap.new_socket()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue