mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 04:09:01 +00:00
Patch to libraries that were inappropriately using globals.
Often two (or more) scripts using the same library would overwrite the globals each was using. This would result in (at best) an error or (at worst) a deadlock. The patch changes the global accesses to local.
This commit is contained in:
@@ -285,14 +285,14 @@ end
|
||||
--- Set the source IP address.
|
||||
-- @param binip The source IP address as a byte string.
|
||||
function Packet:ip_set_bin_src(binip)
|
||||
nrip = u32(binip, 0)
|
||||
local nrip = u32(binip, 0)
|
||||
self:set_u32(self.ip_offset + 12, nrip)
|
||||
self.ip_bin_src = self:raw(self.ip_offset + 12,4) -- raw 4-bytes string
|
||||
end
|
||||
--- Set the destination IP address.
|
||||
-- @param binip The destination IP address as a byte string.
|
||||
function Packet:ip_set_bin_dst(binip)
|
||||
nrip = u32(binip, 0)
|
||||
local nrip = u32(binip, 0)
|
||||
self:set_u32(self.ip_offset + 16, nrip)
|
||||
self.ip_bin_dst = self:raw(self.ip_offset + 16,4)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user