Changeset 8cecc7c


Ignore:
Timestamp:
12/18/06 16:44:37 (15 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
5e85c23
Parents:
eb27e8e
Message:

Looks like we need the get_next_record after all - for some reason dag_advance_stream doesn't deal in whole records like dag_offset did in 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    reb27e8e r8cecc7c  
    550550
    551551dag_record_t *dag_get_record(libtrace_t *libtrace) {
    552         dag_record_t *erfptr;
     552        dag_record_t *erfptr = NULL;
    553553        uint16_t size;
    554554#ifdef DAG_VERSION_2_4
    555555        erfptr = (dag_record_t *) ((char *)DAG.buf + (DAG.bottom + DAG.offset));
    556556#else
    557         erfptr = (dag_record_t *) DAG.bottom;   
    558 #endif
     557        erfptr = (dag_record_t *) dag_rx_stream_next_record(INPUT.fd,
     558                        DAG.dagstream);
     559#endif
     560        if (!erfptr)
     561                return NULL;
    559562        size = ntohs(erfptr->rlen);
    560563        assert( size >= dag_record_size );
     
    586589        int size = 0;
    587590        struct timeval tv;
    588         dag_record_t *erfptr;
     591        dag_record_t *erfptr = NULL;
    589592
    590593        if (DUCK.last_pkt - DUCK.last_duck > DUCK.duck_freq &&
     
    611614                if (numbytes < 0)
    612615                        return numbytes;
    613         } while (numbytes == 0);
    614 
    615         erfptr = dag_get_record(libtrace);
     616                if (numbytes == 0)
     617                        continue;
     618                erfptr = dag_get_record(libtrace);
     619               
     620        } while (erfptr == NULL);
     621
    616622        dag_form_packet(erfptr, packet);
    617623       
Note: See TracChangeset for help on using the changeset viewer.