Skip to content
Permalink
Browse files

Merge PR #1384 (ipv6.reassemble: fix length check) into max-next

  • Loading branch information...
eugeneia committed Jan 29, 2019
2 parents 91ffca3 + 69473eb commit c8f50349046d131e7541ec95cb1c6c74623d8562
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/apps/ipv6/reassemble.lua
@@ -87,7 +87,10 @@ local fragment_header_ptr_t = ffi.typeof('$*', fragment_header_t)
-- Precondition: packet already has IPv6 ethertype.
local function ipv6_packet_has_valid_length(h, len)
if len < ether_ipv6_header_len then return false end
return ntohs(h.ipv6.payload_length) == len - ether_ipv6_header_len
-- The minimum Ethernet frame size is 60 bytes (without FCS). Those
-- frames may contain padding bytes.
local payload_length = ntohs(h.ipv6.payload_length)
return payload_length <= 60 or payload_length == len - ether_ipv6_header_len
end

local function swap(array, i, j)

0 comments on commit c8f5034

Please sign in to comment.
You can’t perform that action at this time.