Ignore:
Timestamp:
05/11/06 11:40:21 (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:
83445f0
Parents:
3fcb8b4
Message:

Fixed segmentation faults when trace_destroy is called on a trace that wasn't successfully created
libdl is now checked for and only linked against if available (BSD's don't have a libdl)
Fixed the libpacketdump .so's to use libtrace's generic protocol headers as well as trace_ether_ntoa
Added missing check for strlcpy
Added a couple of #defines to various tools that needed them under FreeBSD
Removed some needless #includes from the libpacketdump .so's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/eth_2054.cc

    r950d54a r4e65f42  
    11/* ARP */
    2 #include <netinet/ether.h>
    3 #include <netinet/in.h>
    42#include <stdio.h>
    53#include <inttypes.h>
    64#include <dlfcn.h>
    7 #include <map>
    85#include "libpacketdump.h"
    96#include <sys/socket.h>
     7#ifndef WIN32
     8        #include <netinet/in_systm.h>
     9#endif
    1010#include <netinet/in.h>
    1111#include <netinet/ip.h>
    1212#include <net/if_arp.h>
    1313#include <arpa/inet.h>
     14#include <string.h>
    1415
    1516#define DISPLAY_EXP(x,fmt,exp) \
     
    2728{
    2829        static char buffer[1024];
     30        char ether_buf[18] = {0, };
    2931        if (hrd==NULL)
    3032                return "Truncated (Truncated)";
    3133        switch(arp->ar_hrd) {
    3234                case ARPHRD_ETHER:
    33                         strcpy(buffer,ether_ntoa((struct ether_addr*)&hrd));
     35                        strcpy(buffer,trace_ether_ntoa((uint8_t *)&hrd,
     36                                                ether_buf));
    3437                        break;
    3538                default:
Note: See TracChangeset for help on using the changeset viewer.