Skip to content

Commit

Permalink
Presence of linux's PF_PACKET sockets is now detected.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sam-github committed Aug 23, 2011
1 parent 037dc41 commit 5f5a034
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions libnet/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion libnet/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5f5a034

Please sign in to comment.