Ignore:
Timestamp:
04/02/08 16:32:01 (14 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:
dd1217b
Parents:
007fb43
Message:

Some fixes to deal with errors and warnings that appear with old gcc - e.g. 2.95

  • Added 'static' to functions that are only used internally
  • Moved variable declarations to the start of the code block, before any actual code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/ip_6.c

    r4f55f69 rf5d654e  
    2222void decode(int link_type,char *packet,unsigned len)
    2323{
     24        unsigned char *pkt = NULL;
     25        unsigned char type,optlen,*data;
     26        int plen, i;
    2427        libtrace_tcp_t *tcp = (libtrace_tcp_t *)packet;
    2528        printf(" TCP:");
     
    6972        DISPLAYS(check," Checksum %i");
    7073        DISPLAYS(urg_ptr," Urgent %i");
    71         unsigned char *pkt = (unsigned char*)packet+sizeof(*tcp);
    72         int plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp);
    73         unsigned char type,optlen,*data;
     74        pkt = (unsigned char*)packet+sizeof(*tcp);
     75        plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp);
    7476        while(trace_get_next_option(&pkt,&plen,&type,&optlen,&data)) {
    7577                printf("\n TCP: ");
     
    9294                        case 5:
    9395                                printf("SACK Information");
    94                                 int i;
    9596                                i=0;
    9697                                while(i+8<optlen) {
Note: See TracChangeset for help on using the changeset viewer.