Changeset 1839

Show
Ignore:
Timestamp:
04/22/07 15:22:54 (19 months ago)
Author:
aturner
Message:

don't use pcap_findalldevs() on OS X. refs #167

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.in

    r1824 r1839  
    1111dnl Set version info here! 
    1212MAJOR_VERSION=3 
    13 MINOR_VERSION=0 
     13MINOR_VERSION=1 
    1414MICRO_VERSION=0 
    1515TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION 
     
    983983dnl No 'make test' when cross compile 
    984984 
    985 AC_MSG_CHECKING( for 'make test' profile) 
     985AC_MSG_CHECKING(for 'make test' profile) 
    986986if test "$host" != "$build" ; then 
    987987        AC_MSG_WARN(Unable to do tests when cross-compiling) 
     
    995995      AC_MSG_RESULT([Using --with-testnic=$withval])], 
    996996    [ 
     997 
     998dnl There's a bug in OS X which causes pcap_findalldevs() to make the wifi NIC to disassociate 
     999dnl so under OSX we disable the interface list feature 
     1000disable_pcap_findalldevs=no 
     1001 
     1002 
    9971003dnl these need to be dynamic based on OS 
    9981004case $host in 
     
    10181024        nic1=en0 
    10191025        nic2=en0 
     1026        disable_pcap_findalldevs=yes 
    10201027        AC_MSG_RESULT(Apple OS X) 
    10211028        ;; 
     
    10491056AC_SUBST(nic1) 
    10501057AC_SUBST(nic2) 
     1058 
     1059 
     1060AC_MSG_CHECKING([if it's ok to use pcap_findalldevs()]) 
     1061if test x$disable_pcap_findalldevs = xno ; then 
     1062        AC_DEFINE([ENABLE_PCAP_FINDALLDEVS], [1], [Enable use of pcap_findalldevs()]) 
     1063        AC_MSG_RESULT(yes) 
     1064else 
     1065        AC_MSG_RESULT(no) 
     1066fi 
    10511067 
    10521068LIBOPTS_CHECK 
     
    10701086        AC_MSG_WARN([OS X <= 10.4.9 has a serious problem.  Please see: http://tcpreplay.synfin.net/trac/ticket/142]) 
    10711087        ;; 
     1088         
     1089        *-*-cygwin) 
     1090        AC_MSG_WARN([Windows/Cygwin support is still somewhat experimental.  Please report any bugs!]) 
     1091        ;; 
    10721092esac 
  • trunk/src/common/interface.c

    r1766 r1839  
    5555     
    5656    assert(alias); 
    57     assert(list); 
    5857     
    59     ptr = list; 
     58    if (list != NULL) {         
     59        ptr = list; 
    6060     
    61     do { 
    62         /* check both the alias & name fields */ 
    63         if (strcmp(alias, ptr->alias) == 0) 
    64             return(ptr->name); 
     61        do { 
     62            /* check both the alias & name fields */ 
     63            if (strcmp(alias, ptr->alias) == 0) 
     64                return(ptr->name); 
    6565         
    66         if (strcmp(alias, ptr->name) == 0) 
    67             return(ptr->name); 
     66            if (strcmp(alias, ptr->name) == 0) 
     67                return(ptr->name); 
    6868             
    69         ptr = ptr->next; 
    70     } while (ptr != NULL); 
     69            ptr = ptr->next; 
     70        } while (ptr != NULL); 
     71    } else { 
     72        return(alias); 
     73    } 
    7174     
    7275    return(NULL); 
  • trunk/src/config.h.in

    r1820 r1839  
    1515/* Enable building flowreplay (alpha) */ 
    1616#undef ENABLE_FLOWREPLAY 
     17 
     18/* Enable use of pcap_findalldevs() */ 
     19#undef ENABLE_PCAP_FINDALLDEVS 
    1720 
    1821/* Do we have tcpdump and pcap_dump_fopen()? */ 
  • trunk/src/tcpbridge.c

    r1803 r1839  
    159159    char ebuf[SENDPACKET_ERRBUF_SIZE]; 
    160160    char *intname; 
     161#ifdef ENABLE_PCAP_FINDALLDEVS 
    161162    interface_list_t *intlist = get_interface_list(); 
    162  
     163#else 
     164    interface_list_t *intlist = NULL; 
     165#endif 
    163166     
    164167#ifdef DEBUG 
  • trunk/src/tcpreplay.c

    r1820 r1839  
    272272    char ebuf[SENDPACKET_ERRBUF_SIZE]; 
    273273    int int1dlt, int2dlt; 
     274     
     275#ifdef ENABLE_PCAP_FINDALLDEVS 
    274276    interface_list_t *intlist = get_interface_list(); 
    275  
     277#else 
     278    interface_list_t *intlist = NULL; 
     279#endif 
    276280 
    277281#ifdef DEBUG 
  • trunk/src/tcpreplay_opts.def

    r1833 r1839  
    206206 
    207207flag = { 
     208        ifdef           = ENABLE_PCAP_FINDALLDEVS; 
    208209        name            = listnics; 
    209210        value           = N;