Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'return err;' #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CC= gcc
AR=/usr/bin/ar
RANLIB=/usr/bin/ranlib
CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
CCOPT= -O2 -Wall @PCAP_INCLUDE@ @USE_PCAP_BPF@ @TCL_INC@ @USE_TCL@
DEBUG= -g
#uncomment the following if you need libpcap based build under linux
#(not raccomanded)
Expand Down
1 change: 1 addition & 0 deletions apd.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ int ars_d_set_data(struct ars_packet *pkt, int layer, char *f, char *v)
return -ARS_ERROR;
err = ars_push_data(pkt, layer, binary, blen);
free(binary);
return err;
} else if (strcasecmp(f, "uint32") == 0) {
int err;
__u32 t, nt;
Expand Down
31 changes: 19 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ show_help()
echo "--help show this help"
echo "--no-tcl disable TCL scripting support"
echo " even if uid != euid"
echo "--no-pcap-bpf use net/bpf.h instead of pcap/bpf.h"
}

if [ "$1" = "--help" ]; then
Expand Down Expand Up @@ -44,11 +45,11 @@ if [ ! "$CONFIGOSTYPE" ]; then
fi

# for BSD/OS use the historical name as it doesn't include '/'
if [ $CONFIGOSTYPE = "BSD/OS" ]; then
if [ "$CONFIGOSTYPE" = "BSD/OS" ]; then
CONFIGOSTYPE=BSDI
fi

case $CONFIGOSTYPE in
case "$CONFIGOSTYPE" in
SUNOS)
SOLARISLIB="-lsocket -lresolv -lnsl"
BUG='/* #define STUPID_SOLARIS_CHECKSUM_BUG */'
Expand All @@ -63,31 +64,31 @@ esac
#
for TCLPATH_TRY in "/usr/bin/" "/usr/local/bin/" "/bin/"
do
for TCLVER_TRY in "8.4" "8.3" "8.2" "8.1" "8.0"
for TCLVER_TRY in "8.6" "8.5" "8.4" "8.3" "8.2" "8.1" "8.0"
do
if [ -z $TCLSH ]
if [ -z "$TCLSH" ]
then
TCLSH_TRY=${TCLPATH_TRY}tclsh${TCLVER_TRY}
if [ -f $TCLSH_TRY ]
TCLSH_TRY="${TCLPATH_TRY}tclsh${TCLVER_TRY}"
if [ -f "$TCLSH_TRY" ]
then
TCLSH=$TCLSH_TRY
TCLSH="$TCLSH_TRY"
echo "===> Found Tclsh in: $TCLSH"
fi
fi
done
done
if [ -f $TCLSH ]
if [ -f "$TCLSH" ]
then
TCL_VER=`echo puts \\$tcl_version | $TCLSH -`
USE_TCL='-DUSE_TCL'
USE_TCL="-DUSE_TCL"
TCL_LIB="-ltcl${TCL_VER}"
if [ -e /usr/include/tcl${TCL_VER} ]
if [ -e "/usr/include/tcl${TCL_VER}" ]
then
TCL_INC="-I/usr/include/tcl${TCL_VER}"
elif [ -e /usr/include/tcl.h ]
elif [ -e "/usr/include/tcl.h" ]
then
TCL_INC=""
elif [ -e /usr/local/include/tcl${TCL_VER} ]
elif [ -e "/usr/local/include/tcl${TCL_VER}" ]
then
TCL_INC="-I/usr/local/include/tcl${TCL_VER}"
else
Expand All @@ -107,6 +108,7 @@ fi
#
PCAP="PCAP=-lpcap"
PCAP_INCLUDE=""
USE_PCAP_BPF="-DUSE_PCAP_BPF"

for ARG in $*; do
case "$ARG" in
Expand All @@ -116,13 +118,17 @@ for ARG in $*; do
TCL_INC=""
TCL_LIB=""
;;
*"--no-pcap-bpf")
USE_PCAP_BPF=""
;;
esac
done

echo --------------------------------------
echo system type: $CONFIGOSTYPE
echo
echo "LIBPCAP : $PCAP"
echo "USE_PCAP_BPF : $USE_PCAP_BPF"
echo "PCAP_INCLUDE : $PCAP_INCLUDE"
echo "MANPATH : $INSTALL_MANPATH"
echo "USE_TCL : $USE_TCL"
Expand All @@ -136,6 +142,7 @@ echo --------------------------------------

echo creating Makefile...
sed -e "s^@PCAP@^$PCAP^g" \
-e "s^@USE_PCAP_BPF@^$USE_PCAP_BPF^g" \
-e "s^@PCAP_INCLUDE@^$PCAP_INCLUDE^g" \
-e "s^@MANPATH@^$INSTALL_MANPATH^g" \
-e "s^@SOLARISLIB@^$SOLARISLIB^g" \
Expand Down
4 changes: 4 additions & 0 deletions libpcap_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#ifdef USE_PCAP_BPF
#include <pcap/bpf.h>
#else
#include <net/bpf.h>
#endif
#include <pcap.h>

#include "globals.h"
Expand Down
4 changes: 4 additions & 0 deletions script.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include <sched.h>

#include <sys/ioctl.h>
#ifdef USE_PCAP_BPF
#include <pcap/bpf.h>
#else
#include <net/bpf.h>
#endif
#include <pcap.h>

#include "release.h"
Expand Down