Changeset 39c3ce7


Ignore:
Timestamp:
08/31/15 14:30:45 (5 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
206109f, 87cba74
Parents:
7aa2a21
Message:

Dump ICMP checksum with rest of ICMP header

Previously, we were decoding and printing the embedded IP header in TTL
Exceeded and Destination Unreachable messages before printing the Checksum
for the preceding ICMP header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/ip_1.c

    r387d299 r39c3ce7  
    2626{
    2727        libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet;
     28        int ippresent = 0;
    2829        if (len<1)
    2930                return;
     
    4849                                printf(" ICMP: Code: %i (Unknown)\n",icmp->code);
    4950                        }
    50                         // Pretend that this was just passed up from ethernet
    51                         decode_next(packet+8,len-8,
    52                                         "eth",0x0800);
    53 
     51                        ippresent = 1;
    5452                        break;
    5553                case 8:
     
    6260                case 11:
    6361                        printf(" Type: 11 (ICMP TTL Exceeded)\n");
    64                         decode_next(packet+8,len-8,
    65                                         "eth",0x0800);
     62                        ippresent = 1;
    6663                        break;
    6764                default:
     
    7673                printf("%u\n", ntohs(icmp->checksum));
    7774
     75        if (ippresent) {
     76                decode_next(packet+8,len-8,
     77                                "eth",0x0800);
     78        }
     79
    7880
    7981        return;
Note: See TracChangeset for help on using the changeset viewer.