OK, let's try another approach - include <linux/if.h> rather than
<net/if.h>, in the hope that 1) doing so won't cause some problem somewhere and 2) it'll have multiple-include protection (this whole "glibc is a separate project from the kernel, so we'll duplicate header files" thing has its downsides).
This commit is contained in:
parent
26c8745ecf
commit
ba23aa7b42
|
@ -1,5 +1,5 @@
|
|||
#! /bin/sh
|
||||
# From configure.in Revision: 1.166 .
|
||||
# From configure.in Revision: 1.167 .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61.
|
||||
#
|
||||
|
@ -6602,11 +6602,6 @@ echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
|
|||
echo "$as_me: error: version 2 or higher required; see the INSTALL doc for more info" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
#
|
||||
# First try configuring without <net/if.h>, and then try with
|
||||
# <net/if.h>; in some kernel versions, linux/wireless.h includes
|
||||
# net/if.h, and in other versions, it doesn't.
|
||||
#
|
||||
|
||||
for ac_header in linux/wireless.h
|
||||
do
|
||||
|
@ -6624,6 +6619,7 @@ cat >>conftest.$ac_ext <<_ACEOF
|
|||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
|
||||
|
@ -6664,82 +6660,6 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
|
|||
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
|
||||
#
|
||||
# It didn't work without <net/if.h>; try it with
|
||||
# <net/if.h>.
|
||||
#
|
||||
# Unset ac_cv_header_linux_wireless_h so we don't
|
||||
# treat the previous failure as a cached value and
|
||||
# suppress the next test.
|
||||
#
|
||||
{ echo "$as_me:$LINENO: Rechecking with some additional includes" >&5
|
||||
echo "$as_me: Rechecking with some additional includes" >&6;}
|
||||
unset ac_cv_header_linux_wireless_h
|
||||
|
||||
for ac_header in linux/wireless.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
|
||||
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
|
||||
#include <$ac_header>
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
eval "$as_ac_Header=yes"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
eval "$as_ac_Header=no"
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&6; }
|
||||
if test `eval echo '${'$as_ac_Header'}'` = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
|
30
configure.in
30
configure.in
|
@ -1,4 +1,4 @@
|
|||
dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.166 2008-12-14 21:03:07 guy Exp $ (LBL)
|
||||
dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.167 2008-12-14 22:00:57 guy Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1994, 1995, 1996, 1997
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
|
@ -6,7 +6,7 @@ dnl
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
|
||||
AC_REVISION($Revision: 1.166 $)
|
||||
AC_REVISION($Revision: 1.167 $)
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(pcap.c)
|
||||
|
||||
|
@ -357,32 +357,10 @@ linux)
|
|||
if test $ac_cv_linux_vers -lt 2 ; then
|
||||
AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
|
||||
fi
|
||||
#
|
||||
# First try configuring without <net/if.h>, and then try with
|
||||
# <net/if.h>; in some kernel versions, linux/wireless.h includes
|
||||
# net/if.h, and in other versions, it doesn't.
|
||||
#
|
||||
AC_CHECK_HEADERS(linux/wireless.h, [],
|
||||
[
|
||||
#
|
||||
# It didn't work without <net/if.h>; try it with
|
||||
# <net/if.h>.
|
||||
#
|
||||
# Unset ac_cv_header_linux_wireless_h so we don't
|
||||
# treat the previous failure as a cached value and
|
||||
# suppress the next test.
|
||||
#
|
||||
AC_MSG_NOTICE([Rechecking with some additional includes])
|
||||
unset ac_cv_header_linux_wireless_h
|
||||
AC_CHECK_HEADERS(linux/wireless.h, [], [],
|
||||
[
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <linux/types.h>
|
||||
])
|
||||
],
|
||||
AC_CHECK_HEADERS(linux/wireless.h, [], [],
|
||||
[
|
||||
#include <sys/socket.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/types.h>
|
||||
])
|
||||
AC_LBL_TPACKET_STATS
|
||||
|
|
14
pcap-linux.c
14
pcap-linux.c
|
@ -34,7 +34,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.163 2008-12-14 20:30:11 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.164 2008-12-14 22:00:57 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -93,21 +93,19 @@ static const char rcsid[] _U_ =
|
|||
#include <sys/ioctl.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/mman.h>
|
||||
#include <linux/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <poll.h>
|
||||
|
||||
/*
|
||||
* Got Wireless Extensions?
|
||||
*/
|
||||
#ifdef HAVE_LINUX_WIRELESS_H
|
||||
#include <linux/wireless.h>
|
||||
#else
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include "pcap-int.h"
|
||||
#include "pcap/sll.h"
|
||||
#include "pcap/vlan.h"
|
||||
|
|
Reference in New Issue