Skip to content

Commit

Permalink
Use proper flow start time after active timeout
Browse files Browse the repository at this point in the history
The flow start time iss set to o the time of the last flow exp after
an active timeout.  Itt needs to be reset to the time when the first
packet t is received.
  • Loading branch information
alexandergall committed Feb 23, 2021
1 parent 4296bfa commit fc407c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/apps/ipfix/template.lua
Expand Up @@ -396,6 +396,14 @@ local function extract_5_tuple(pkt, timestamp, entry, md, extract_addr_fn)
end

local function accumulate_generic(dst, new)
-- If dst is a flow entry which has been cleared after an active
-- timeout and this is the first packet received since then,
-- flowStartMilliseconds is the time at which the flow was last
-- exported rather than the time at which the flow actually started
-- in the new active window.
if dst.value.packetDeltaCount == 0 then
dst.value.flowStartMilliseconds = new.value.flowStartMilliseconds
end
dst.value.flowEndMilliseconds = new.value.flowEndMilliseconds
dst.value.packetDeltaCount = dst.value.packetDeltaCount + 1
dst.value.octetDeltaCount =
Expand Down

0 comments on commit fc407c2

Please sign in to comment.