mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Resolves ether_type incompatibility in packet.Frame
Frame:new() was populating the value as a 16-bit integer while Frame:build_ether_frame() was expectng a two-byte string Ethertype constants from various locations have been migrated to packet.lua
This commit is contained in:
@@ -105,14 +105,14 @@ ATAoE = {
|
||||
-- Send a Config Info Request to the ethernet broadcast address
|
||||
-- @param iface table as returned by nmap.get_interface_info()
|
||||
local function sendConfigInfoRequest(iface)
|
||||
local ETHER_BROADCAST, P_ATAOE = "ff:ff:ff:ff:ff:ff", 0x88a2
|
||||
local ETHER_BROADCAST = "ff:ff:ff:ff:ff:ff"
|
||||
local req = ATAoE.ConfigInfoRequest:new()
|
||||
local tag = req.tag
|
||||
|
||||
local p = packet.Frame:new()
|
||||
p.mac_src = iface.mac
|
||||
p.mac_dst = packet.mactobin(ETHER_BROADCAST)
|
||||
p.ether_type = string.pack(">I2", P_ATAOE)
|
||||
p.ether_type = packet.ETHER_TYPE_ATAOE
|
||||
p.buf = tostring(req)
|
||||
p:build_ether_frame()
|
||||
|
||||
|
||||
@@ -147,8 +147,7 @@ local function dhcp_listener(sock, iface, macaddr, options, timeout, xid, result
|
||||
-- Add the Ethernet header
|
||||
frame:build_ether_frame(
|
||||
"\xff\xff\xff\xff\xff\xff",
|
||||
iface.mac, -- can't use macaddr or we won't see response
|
||||
packet.ETHER_TYPE_IPV4)
|
||||
iface.mac) -- can't use macaddr or we won't see response
|
||||
|
||||
local dnet = nmap.new_dnet()
|
||||
dnet:ethernet_open(iface.device)
|
||||
|
||||
Reference in New Issue
Block a user