Changeset 4bbe9bd


Ignore:
Timestamp:
08/02/10 15:48:16 (11 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:
1326d5f
Parents:
9b097ea
Message:
  • Add check for the presence of sdl_len in the sockaddr_dl structure - OpenSolaris? doesn't seem to believe in length fields, which creates obvious issues
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    r7aebb85 r4bbe9bd  
    164164 #include <net/if.h>
    165165])
     166
     167if test "$libtrace_netpacket_packet_h" != "true"; then
     168# Check for sdl_len in sockaddr_dl
     169        AC_CHECK_MEMBER([struct sockaddr_dl.sdl_len],
     170                AC_DEFINE(HAVE_SDL_LEN,1,[Has sdl_len in sockaddr_dl]),,[
     171 #include <sys/types.h>
     172 #include <sys/socket.h>
     173 #include <net/if_dl.h>
     174                ])
     175fi
     176
     177               
     178
    166179
    167180# Checking for the right bpf header to include
  • lib/protocols_l3.c

    r3c2ddf4 r4bbe9bd  
    3333
    3434
     35#include "libtrace_int.h"
    3536#include "libtrace.h"
    3637#include "protocols.h"
    3738#include <assert.h>
    3839#include <stdlib.h>
    39 #include "config.h"
    4040
    4141#ifdef HAVE_NETPACKET_PACKET_H
     
    346346       
    347347        l2addr->sdl_family = AF_LINK;
     348#if HAVE_SDL_LEN == 1
    348349        l2addr->sdl_len = sizeof(struct sockaddr_dl);
     350#endif
    349351        l2addr->sdl_index = 0; /* Unused */
    350352        l2addr->sdl_alen = 6; /* Address length  */
     
    466468       
    467469        l2addr->sdl_family = AF_LINK;
     470#if HAVE_SDL_LEN == 1
    468471        l2addr->sdl_len = sizeof(struct sockaddr_dl);
     472#endif
    469473        l2addr->sdl_index = 0; /* Unused */
    470474        l2addr->sdl_alen = 6; /* Address length  */
Note: See TracChangeset for help on using the changeset viewer.