Changeset 1812

Show
Ignore:
Timestamp:
04/15/07 11:04:30 (21 months ago)
Author:
aturner
Message:

no longer offically support or by default use libnet. You must
now specify --enable-libnet to link it. However, you may need to use
--enable-force-libnet to actually select it. fixes #148

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.in

    r1808 r1812  
    289289 
    290290dnl ################################################## 
    291 dnl Checks for libnet (shamelessly horked from dsniff) 
     291dnl Checks for libnet IFF you specify --enable-libnet. 
     292dnl We no longer by default use libnet unless you tell me to. 
    292293dnl ################################################## 
    293294foundnet=no 
    294 trynetdir=/usr/local 
    295 AC_MSG_CHECKING(for libnet) 
     295trynetdir=no 
     296have_libnet=no 
     297 
     298AC_ARG_ENABLE(libnet, 
     299        AC_HELP_STRING([--enable-libnet], [Enable using the libnet 1.1.x library (unsupported)]), 
     300        [ if test x$enableval = xyes; then 
     301                trynetdir=yes 
     302                AC_MSG_WARN([Due to bugs in libnet, it is no longer officially supported]) 
     303          fi] 
     304) 
     305 
    296306AC_ARG_WITH(libnet, 
    297307    AC_HELP_STRING([--with-libnet=DIR], [Use libnet in DIR]), 
    298308    [trynetdir=$withval]) 
    299309 
    300 for testdir in $trynetdir /usr/local /opt/local /usr ; do 
    301     if test -f "${testdir}/include/libnet.h" -a $foundnet = no ; then 
    302      LNETINC="${testdir}/include/libnet.h" 
    303      LNETINCDIR="$testdir/include" 
    304      if test $dynamic_link = yes; then 
    305          LNETLIB="-L${testdir}/lib -lnet" 
    306      elif test -f "${testdir}/lib64/libnet.a" ; then 
    307          LNETLIB="${testdir}/lib64/libnet.a" 
    308      else 
    309          LNETLIB="${testdir}/lib/libnet.a" 
    310      fi 
    311      foundnet=$testdir 
    312     fi 
    313 done 
    314  
    315 if test $foundnet = no ; then 
    316     AC_MSG_RESULT(no) 
    317 else  
    318     AC_MSG_RESULT($foundnet)  
    319         AC_DEFINE([HAVE_LIBNET], [1], [Enable libnet support]) 
    320 fi 
     310if test x$trynetdir = xyes ; then 
     311        AC_MSG_CHECKING(for libnet) 
     312 
     313        for testdir in $trypcapdir /usr/local /opt/local /usr ; do  
     314        if test -f "${testdir}/include/libnet.h" -a $foundnet = no ; then 
     315                LNETINC="${testdir}/include/libnet.h" 
     316                LNETINCDIR="${testdir}/include" 
     317                if test $dynamic_link = yes; then 
     318                                if test -f "${testdir}/lib/libnet.a" ; then 
     319                            LPCAPLIB="-L${testdir}/lib -lnet" 
     320                                elif test -f "${testdir}/lib64/libnet.a" ; then 
     321                                        LPCAPLIB="-L${testdir}/lib64 -lnet" 
     322                                else 
     323                                        AC_ERROR([Unable to find libnet in ${testdir}]) 
     324                                fi 
     325                elif test -f "${testdir}/lib64/libnet.a" ; then 
     326                    LNETLIB="${testdir}/lib64/libnet.a" 
     327                elif test -f "${testdir}/lib/libnet.a" ; then 
     328                    LNETLIB="${testdir}/lib/libnet.a" 
     329                        else 
     330                                AC_ERROR([Unable to find matching library for header file in ${testdir}]) 
     331                        fi 
     332                foundnet=$testdir 
     333        fi 
     334        done 
     335         
     336 
     337        if test x$foundnet = xno ; then 
     338            AC_MSG_RESULT(no) 
     339        else 
     340            AC_MSG_RESULT($foundnet) 
     341                have_libnet=yes 
     342                AC_DEFINE([HAVE_LIBNET], [1], [Enable libnet support]) 
     343        fi 
     344 
     345fi 
     346 
    321347 
    322348AC_SUBST(LNETINC) 
    323349AC_SUBST(LNETLIB) 
    324350 
    325 if test $foundnet = yes ; then 
     351if test $foundnet != no ; then 
    326352        OLDLIBS="$LIBS" 
    327353        OLDCFLAGS="$CFLAGS" 
     
    453479 
    454480 
    455 have_libnet=no 
    456481dnl Check to see what version of libpcap 
    457482dnl this code has been reduced a lot, but probably still could be 
     
    717742if test $have_bpf = no -a $have_pcap_inject = no -a $have_pcap_sendpacket = no \ 
    718743        -a $have_libnet = no -a $have_pf = no ; then 
    719         AC_MSG_ERROR([Unable to find a supported method to send packets]) 
     744        AC_MSG_ERROR([Unable to find a supported method to send packets.  Please upgrade your libpcap or enable libnet]) 
    720745fi 
    721746 
  • trunk/docs/CHANGELOG

    r1807 r1812  
    11$Id$ 
     2 
     305/??/2007: Version 3.0 
     4        - By default, no longer try to use libnet.  You must now specify --enable-libnet (#148) 
    25 
    3604/14/2007: Version 3.0.RC1