mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Takes advantage of freshly implemented ipOps.get_first_ip()
This commit is contained in:
@@ -1414,8 +1414,7 @@ function addClientSubnet(pkt,Z,subnet)
|
|||||||
-- Per RFC 7871, section 6:
|
-- Per RFC 7871, section 6:
|
||||||
-- Address must have all insignificant bits zeroed out and insignificant bytes
|
-- Address must have all insignificant bits zeroed out and insignificant bytes
|
||||||
-- must be trimmed off. (/24 IPv4 address is submitted as 3 octets, not 4.)
|
-- must be trimmed off. (/24 IPv4 address is submitted as 3 octets, not 4.)
|
||||||
local addr = ipOps.ip_to_bin(subnet.address)
|
local addr = ipOps.get_first_ip(subnet.address, mask)
|
||||||
addr = ipOps.bin_to_ip(addr:sub(1, mask) .. ("0"):rep(#addr - mask))
|
|
||||||
addr = ipOps.ip_to_str(addr):sub(1, (mask + 7) // 8)
|
addr = ipOps.ip_to_str(addr):sub(1, (mask + 7) // 8)
|
||||||
local data = bin.pack(">SCCA", family, mask, scope_mask, addr)
|
local data = bin.pack(">SCCA", family, mask, scope_mask, addr)
|
||||||
local opt = bin.pack(">SS",code, #data) .. data
|
local opt = bin.pack(">SS",code, #data) .. data
|
||||||
|
|||||||
Reference in New Issue
Block a user