1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 19:09:01 +00:00

Fixed a bug in packet.lua library that caused tcp_data_length to have an incorrect size in IPv6 packets due to IPv4 packet length and IPv6 payload length fields being used the same way to calculate tcp_data_length.

This commit is contained in:
kroosec
2012-06-15 16:08:00 +00:00
parent 08e2f98ebe
commit 6f29a6a1d4

View File

@@ -952,8 +952,11 @@ function Packet:tcp_parse(force_continue)
self.tcp_options = self:parse_options(self.tcp_opt_offset, ((self.tcp_hl*4)-20))
self.tcp_data_offset = self.tcp_offset + self.tcp_hl*4
local plen = self.ip_len or self.ip6_plen
self.tcp_data_length = plen - self.tcp_offset - self.tcp_hl*4
if self.ip_len then
self.tcp_data_length = self.ip_len - self.tcp_offset - self.tcp_hl*4
else
self.tcp_data_length = self.ip6_plen - self.tcp_hl*4
end
self:tcp_parse_options()
return true
end