mirror of
https://github.com/nmap/nmap.git
synced 2026-11-19 22:20:49 +00:00
Streamline ipOps.todword
This commit is contained in:
parent
1c7be2c6fc
commit
f7b15447bf
1 changed files with 3 additions and 7 deletions
|
|
@ -125,13 +125,9 @@ todword = function( ip )
|
|||
return nil, "Error in ipOps.todword: Expected IPv4 address."
|
||||
end
|
||||
|
||||
local n, ret, err = {}
|
||||
n, err = get_parts_as_number( ip )
|
||||
if err then return nil, err end
|
||||
|
||||
ret = (((n[1]*256+n[2]))*256+n[3])*256+n[4]
|
||||
|
||||
return ret
|
||||
local octets, err = get_parts_as_number( ip )
|
||||
if not octets then return nil, err end
|
||||
return (((octets[1]*256+octets[2]))*256+octets[3])*256+octets[4]
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue