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

Replace some string.char and bin.pack calls with literals

This commit is contained in:
dmiller
2015-02-27 19:42:56 +00:00
parent 204d37e4d7
commit 0e74dd7a35
37 changed files with 85 additions and 97 deletions

View File

@@ -429,9 +429,9 @@ function dhcp_build(request_type, ip_address, mac_address, options, request_opti
packet = packet .. bin.pack("<I", overrides['yiaddr'] or 0) -- yiaddr
packet = packet .. bin.pack("<I", overrides['siaddr'] or 0) -- siaddr
packet = packet .. bin.pack("<I", overrides['giaddr'] or 0) -- giaddr
packet = packet .. mac_address .. string.rep(string.char(0), 16 - #mac_address) -- chaddr (MAC address)
packet = packet .. (overrides['sname'] or string.rep(string.char(0), 64)) -- sname
packet = packet .. (overrides['file'] or string.rep(string.char(0), 128)) -- file
packet = packet .. mac_address .. string.rep('\0', 16 - #mac_address) -- chaddr (MAC address)
packet = packet .. (overrides['sname'] or string.rep('\0', 64)) -- sname
packet = packet .. (overrides['file'] or string.rep('\0', 128)) -- file
packet = packet .. bin.pack(">I", overrides['cookie'] or 0x63825363) -- Magic cookie
-- Options