File libnet-detect-presence-of-PF_PACKET.patch of Package libnet.openSUSE_12.1_Update
commit 5f5a034d217e6beec837b3aafdb6afbb669f648b
Author: Sam Roberts <vieuxtech@gmail.com>
Date: Tue Aug 23 11:48:06 2011 -0700
Presence of linux's PF_PACKET sockets is now detected.
The acinclude.m4 merged in from packetfactory's 1.1.3-rc branch
mysteriously assumed that that there was no PF_PACKET if the target
OS was linux, which is the opposite of what we want.
diff --git a/acinclude.m4 b/acinclude.m4
index 0913021..064b582 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -39,17 +39,10 @@ dnl
AC_DEFUN([AC_LIBNET_CHECK_PF_PACKET],
[
- AC_MSG_CHECKING(for packet socket (PF_SOCKET))
+ AC_MSG_CHECKING(for packet socket (PF_PACKET))
AC_CACHE_VAL(libnet_cv_have_packet_socket,
- [case "$target_os" in
-
- linux*)
- libnet_cv_have_packet_socket=no
- AC_MSG_RESULT(no)
- ;;
- *)
-
+ [
cat > pf_packet-test.c << EOF
#include <stdio.h>
#include <errno.h>
@@ -110,8 +103,8 @@ EOF
fi
rm -f pf_packet-test* core core.pf_packet-test
- ;;
- esac])
+
+ ])
if test $libnet_cv_have_packet_socket = yes -o $libnet_cv_have_packet_socket = probably; then
AC_DEFINE(HAVE_PACKET_SOCKET, 1,
diff --git a/configure.in b/configure.in
index 9015696..7d57601 100644
--- a/configure.in
+++ b/configure.in
@@ -84,7 +84,7 @@ if test -n "${with_link_layer}"; then
none) AC_LIBOBJ([libnet_link_none]) ;;
*) AC_MSG_ERROR([Invalid link type "${with_link_layer}"]) ;;
esac
- AC_MSG_RESULT(forced link layer to ${with_link_layer})
+ AC_MSG_RESULT(user selected link layer ${with_link_layer})
elif test "${cross_compiling}" != "yes" -a -r /dev/bpf0 ; then
AC_LIBOBJ([libnet_link_bpf])
AC_MSG_RESULT(found link layer bpf)