fako1024/slimcap

Mock piping may cause stray packets on ring buffer when wrapping around

Closed this issue · 0 comments

When piping packets from one mock source to another it may happen that after completing a full block int the ring buffer there is a warning (from the crude debugging statement to be removed in #6):

mock WUT (after resetting)? 0 150

This is caused by the forced block finalization which may leave the nextOffset value from a previous run through that block untouched, pointing to a next packet that doesn't exist. This doesn't cause catastrophic problems (because the nextPacket() call doesn't advance beyond the expected number of packets in said block) but it's an easy fix (issue was discovered when implementing mock E2E tests in els0r/goProbe#88)