Ignore:
Timestamp:
09/04/18 14:27:26 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop, master, ringdecrementfix, ringperformance
Children:
ebed638
Parents:
6646938
Message:

Tag each packet with the start iteration of the parent trace.

Traces can be started, paused and then restarted. For some
formats (especially live ones), this will mean that buffers
containing received packets can be destroyed and recreated as
a result of that process. However, in our parallel world we might
also have lingering references to packets that lived in a
now-destroyed buffer and bad things will happen if we try to
operate on it.

To try and avoid this, we keep track of how many times a trace has
been "started" and each packet read is tagged with the start count
at the time it was read. Later processing functions can now check
if the packet was read before the most recent "start" -- if it was,
then it is potentially bogus and should be ignored.

This shouldn't change anything for the vast majority of libtrace
use-cases. Normally, pausing is only used prior to ending an
input without subsequent restarting, i.e. there is only one start
iteration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_pktmeta.c

    r59b2ed8 r37ee856  
    186186                case TRACE_TYPE_OPENBSD_LOOP:
    187187                case TRACE_TYPE_UNKNOWN:
     188                case TRACE_TYPE_CONTENT_INVALID:
    188189                        return NULL;
    189190        }
     
    249250                case TRACE_TYPE_ERF_META:
    250251                case TRACE_TYPE_UNKNOWN:
     252                case TRACE_TYPE_CONTENT_INVALID:
    251253                        /* In this case, the pointer passed in does not point
    252254                         * to a metadata header and so we cannot get the
Note: See TracChangeset for help on using the changeset viewer.