diff --git a/examples/pcap/replay-pcap.lua b/examples/pcap/replay-pcap.lua index b2f0f8104..15c189d69 100644 --- a/examples/pcap/replay-pcap.lua +++ b/examples/pcap/replay-pcap.lua @@ -30,6 +30,7 @@ function master(args) end function replay(queue, file, loop, rateLimiter, multiplier) + log:info("[REPLAY]: Start Replay") local mempool = memory:createMemPool(4096) local bufs = mempool:bufArray() local pcapFile = pcap:newReader(file) @@ -43,6 +44,9 @@ function replay(queue, file, loop, rateLimiter, multiplier) prev = bufs.array[0].udata64 end for i, buf in ipairs(bufs) do + if buf == nil then + break + end -- ts is in microseconds local ts = buf.udata64 if prev > ts then