1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

New function stdnse.format_mac

This function will format a MAC address as colon-separated hex bytes.
It's really very simple: stdnse.tohex(mac, {separator=":"})

This commit updates all the instances I could find of the varying
convoluted attempts at performing this conversion.
This commit is contained in:
dmiller
2014-01-16 21:50:30 +00:00
parent a6b79f9976
commit 197f28265f
13 changed files with 21 additions and 83 deletions

View File

@@ -126,7 +126,7 @@ local function single_interface_broadcast(if_nfo, results)
if target.ALLOW_NEW_TARGETS then
target.add(target_str)
end
results[target_str] = { address = target_str, mac = stdnse.tohex(l2reply.mac_src, {separator = ":", group = 2}), iface = if_nfo.device }
results[target_str] = { address = target_str, mac = stdnse.format_mac(l2reply.mac_src), iface = if_nfo.device }
end
end
end