Ignore:
Timestamp:
01/08/19 10:36:06 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
93564ff
Parents:
4ac48fa (diff), f47025d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'pcapng_write' of git://github.com/jacobvw/libtrace into jacobvw-pcapng_write

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_ring.c

    r8df87c4 r32de4c7  
    7171static int pagesize = 0;
    7272
     73static bool linuxring_can_write(libtrace_packet_t *packet) {
     74        /* Get the linktype */
     75        libtrace_linktype_t ltype = trace_get_link_type(packet);
     76
     77        if (ltype == TRACE_TYPE_NONDATA) {
     78                return false;
     79        }
     80
     81        return true;
     82}
    7383
    7484/*
     
    709719                                  libtrace_packet_t *packet)
    710720{
     721        /* Check linuxring can write this type of packet */
     722        if (!linuxring_can_write(packet)) {
     723                return 0;
     724        }
     725
    711726        struct tpacket2_hdr *header;
    712727        struct pollfd pollset;
     
    715730        unsigned max_size;
    716731        void * off;
    717 
    718         if (trace_get_link_type(packet) == TRACE_TYPE_NONDATA)
    719                 return 0;
    720732
    721733        max_size = FORMAT_DATA_OUT->req.tp_frame_size -
Note: See TracChangeset for help on using the changeset viewer.