[Dhcp-agent-commits] dhcp-agent TODO,1.29,1.30 acconfig.h,1.6,1.7 acinclude.m4,1.8,1.9 aclocal.m4,1.
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-06-23 03:29:16
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv8341 Modified Files: TODO acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in dhcp-client.c dhcp-net.c dhcp-net.h dhcp-sniff.c Log Message: bsd BPF polling fix; we're now at the mercy of select(); Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** TODO 18 Jun 2002 04:33:40 -0000 1.29 --- TODO 23 Jun 2002 03:29:12 -0000 1.30 *************** *** 92,94 **** the applicable dhcp-convert and then build the option wirh create_dhcp_option(data, len, tag) ! -- document output from dhcpsniff -- especially how brief mode is layed out. \ No newline at end of file --- 92,94 ---- the applicable dhcp-convert and then build the option wirh create_dhcp_option(data, len, tag) ! -- document output from dhcpsniff -- especially how brief mode is layed out. Index: acconfig.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/acconfig.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** acconfig.h 10 Jun 2002 23:15:20 -0000 1.6 --- acconfig.h 23 Jun 2002 03:29:12 -0000 1.7 *************** *** 2,5 **** --- 2,8 ---- * our own pri macros. */ + /* have bpf IMMEDIATE ioctl */ + #undef HAVE_BPF_IMMEDIATE + /* have __progname var */ #undef HAVE_PROGNAME Index: acinclude.m4 =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/acinclude.m4,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** acinclude.m4 11 Jun 2002 01:58:53 -0000 1.8 --- acinclude.m4 23 Jun 2002 03:29:12 -0000 1.9 *************** *** 203,204 **** --- 203,219 ---- } ], [AC_DEFINE(KILL_SIGNAL_DETECT) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) + + + AC_DEFUN(AC_WF_CHECK_BPF_IMMEDIATE, + [AC_MSG_CHECKING(for bpf immediate ioctl) + AC_TRY_COMPILE([#include <stdio.h> + #include <stdlib.h> + #include <sys/types.h> + #include <sys/time.h> + #include <sys/ioctl.h> + #include <net/bpf.h> + #include <net/bpfdesc.h> + ], [ ioctl(0, BIOCIMMEDIATE, NULL);], + [AC_MSG_RESULT(found) + AC_DEFINE(HAVE_BPF_IMMEDIATE)], + AC_MSG_RESULT(not found))]) Index: aclocal.m4 =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/aclocal.m4,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** aclocal.m4 11 Jun 2002 01:58:53 -0000 1.8 --- aclocal.m4 23 Jun 2002 03:29:12 -0000 1.9 *************** *** 216,219 **** --- 216,234 ---- ], [AC_DEFINE(KILL_SIGNAL_DETECT) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) + + AC_DEFUN(AC_WF_CHECK_BPF_IMMEDIATE, + [AC_MSG_CHECKING(for bpf immediate ioctl) + AC_TRY_COMPILE([#include <stdio.h> + #include <stdlib.h> + #include <sys/types.h> + #include <sys/time.h> + #include <sys/ioctl.h> + #include <net/bpf.h> + #include <net/bpfdesc.h> + ], [ ioctl(0, BIOCIMMEDIATE, NULL);], + [AC_MSG_RESULT(found) + AC_DEFINE(HAVE_BPF_IMMEDIATE)], + AC_MSG_RESULT(not found))]) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. Index: config.h.in =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/config.h.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** config.h.in 15 Jun 2002 14:59:20 -0000 1.12 --- config.h.in 23 Jun 2002 03:29:12 -0000 1.13 *************** *** 3,6 **** --- 3,9 ---- * our own pri macros. */ + /* have bpf IMMEDIATE ioctl */ + #undef HAVE_BPF_IMMEDIATE + /* have __progname var */ #undef HAVE_PROGNAME Index: configure =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/configure,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** configure 15 Jun 2002 14:59:20 -0000 1.21 --- configure 23 Jun 2002 03:29:12 -0000 1.22 *************** *** 2706,2711 **** rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext fi ! echo "$as_me:2709: checking for struct bpf_timeval" >&5 echo $ECHO_N "checking for struct bpf_timeval... $ECHO_C" >&6 if test "${ac_cv_type_struct_bpf_timeval+set}" = set; then --- 2706,2757 ---- rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext fi + echo "$as_me:2708: checking for bpf immediate ioctl" >&5 + echo $ECHO_N "checking for bpf immediate ioctl... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line 2711 "configure" + #include "confdefs.h" + #include <stdio.h> + #include <stdlib.h> + #include <sys/types.h> + #include <sys/time.h> + #include <sys/ioctl.h> + #include <net/bpf.h> + #include <net/bpfdesc.h> ! int ! main () ! { ! ioctl(0, BIOCIMMEDIATE, NULL); ! ; ! return 0; ! } ! _ACEOF ! rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2730: \"$ac_compile\"") >&5 ! (eval $ac_compile) 2>&5 ! ac_status=$? ! echo "$as_me:2733: \$? = $ac_status" >&5 ! (exit $ac_status); } && ! { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2736: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:2739: \$? = $ac_status" >&5 ! (exit $ac_status); }; }; then ! echo "$as_me:2741: result: found" >&5 ! echo "${ECHO_T}found" >&6 ! cat >>confdefs.h <<\EOF ! #define HAVE_BPF_IMMEDIATE 1 ! EOF ! ! else ! echo "$as_me: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! echo "$as_me:2750: result: not found" >&5 ! echo "${ECHO_T}not found" >&6 ! fi ! rm -f conftest.$ac_objext conftest.$ac_ext ! ! echo "$as_me:2755: checking for struct bpf_timeval" >&5 echo $ECHO_N "checking for struct bpf_timeval... $ECHO_C" >&6 if test "${ac_cv_type_struct_bpf_timeval+set}" = set; then *************** *** 2713,2717 **** else cat >conftest.$ac_ext <<_ACEOF ! #line 2715 "configure" #include "confdefs.h" #include <sys/types.h> --- 2759,2763 ---- else cat >conftest.$ac_ext <<_ACEOF ! #line 2761 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2732,2745 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2734: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2737: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2740: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2743: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_struct_bpf_timeval=yes --- 2778,2791 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2780: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2783: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2786: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2789: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_struct_bpf_timeval=yes *************** *** 2751,2755 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2753: result: $ac_cv_type_struct_bpf_timeval" >&5 echo "${ECHO_T}$ac_cv_type_struct_bpf_timeval" >&6 if test $ac_cv_type_struct_bpf_timeval = yes; then --- 2797,2801 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2799: result: $ac_cv_type_struct_bpf_timeval" >&5 echo "${ECHO_T}$ac_cv_type_struct_bpf_timeval" >&6 if test $ac_cv_type_struct_bpf_timeval = yes; then *************** *** 2760,2767 **** fi ! echo "$as_me:2762: checking for __progname" >&5 echo $ECHO_N "checking for __progname... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF ! #line 2765 "configure" #include "confdefs.h" --- 2806,2813 ---- fi ! echo "$as_me:2808: checking for __progname" >&5 echo $ECHO_N "checking for __progname... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF ! #line 2811 "configure" #include "confdefs.h" *************** *** 2781,2794 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2783: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2786: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2789: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2792: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF --- 2827,2840 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2829: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2832: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2835: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2838: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF *************** *** 2796,2810 **** EOF ! echo "$as_me:2798: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ! echo "$as_me:2803: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext; ! echo "$as_me:2808: checking for sig_atomic_t" >&5 echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6 if test "${ac_cv_type_sig_atomic_t+set}" = set; then --- 2842,2856 ---- EOF ! echo "$as_me:2844: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ! echo "$as_me:2849: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext; ! echo "$as_me:2854: checking for sig_atomic_t" >&5 echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6 if test "${ac_cv_type_sig_atomic_t+set}" = set; then *************** *** 2812,2816 **** else cat >conftest.$ac_ext <<_ACEOF ! #line 2814 "configure" #include "confdefs.h" #include <signal.h> --- 2858,2862 ---- else cat >conftest.$ac_ext <<_ACEOF ! #line 2860 "configure" #include "confdefs.h" #include <signal.h> *************** *** 2828,2841 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2830: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2833: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2836: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2839: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_sig_atomic_t=yes --- 2874,2887 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2876: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2879: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2882: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2885: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_sig_atomic_t=yes *************** *** 2847,2851 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2849: result: $ac_cv_type_sig_atomic_t" >&5 echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6 if test $ac_cv_type_sig_atomic_t = yes; then --- 2893,2897 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2895: result: $ac_cv_type_sig_atomic_t" >&5 echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6 if test $ac_cv_type_sig_atomic_t = yes; then *************** *** 2856,2860 **** fi ! echo "$as_me:2858: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then --- 2902,2906 ---- fi ! echo "$as_me:2904: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then *************** *** 2862,2866 **** else cat >conftest.$ac_ext <<_ACEOF ! #line 2864 "configure" #include "confdefs.h" #include <sys/types.h> --- 2908,2912 ---- else cat >conftest.$ac_ext <<_ACEOF ! #line 2910 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2884,2897 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2886: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2889: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2892: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2895: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void --- 2930,2943 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2932: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2935: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2938: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2941: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void *************** *** 2903,2907 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2905: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 --- 2949,2953 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2951: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 *************** *** 2912,2916 **** if test -z "$pcap_prefix"; then ! echo "$as_me:2914: checking for pcap library directory" >&5 echo $ECHO_N "checking for pcap library directory... $ECHO_C" >&6 ac_pcap_lib_dir="none" --- 2958,2962 ---- if test -z "$pcap_prefix"; then ! echo "$as_me:2960: checking for pcap library directory" >&5 echo $ECHO_N "checking for pcap library directory... $ECHO_C" >&6 ac_pcap_lib_dir="none" *************** *** 2923,2927 **** if test $ac_pcap_lib_dir = "none" ; then ! { { echo "$as_me:2925: error: I cannot find the pcap library anywhere. Perhaps you did not install the pcap package, or you did not install its development header files." >&5 --- 2969,2973 ---- if test $ac_pcap_lib_dir = "none" ; then ! { { echo "$as_me:2971: error: I cannot find the pcap library anywhere. Perhaps you did not install the pcap package, or you did not install its development header files." >&5 *************** *** 2932,2940 **** fi ! echo "$as_me:2934: result: $ac_pcap_lib_dir" >&5 echo "${ECHO_T}$ac_pcap_lib_dir" >&6 PCAP_LIB="-L$ac_pcap_lib_dir -lpcap" ! echo "$as_me:2938: checking for pcap header directory" >&5 echo $ECHO_N "checking for pcap header directory... $ECHO_C" >&6 ac_pcap_header_dir="none" --- 2978,2986 ---- fi ! echo "$as_me:2980: result: $ac_pcap_lib_dir" >&5 echo "${ECHO_T}$ac_pcap_lib_dir" >&6 PCAP_LIB="-L$ac_pcap_lib_dir -lpcap" ! echo "$as_me:2984: checking for pcap header directory" >&5 echo $ECHO_N "checking for pcap header directory... $ECHO_C" >&6 ac_pcap_header_dir="none" *************** *** 2947,2951 **** if test $ac_pcap_header_dir = "none" ; then ! { { echo "$as_me:2949: error: I cannot find the pcap header file anywhere. Perhaps you did not install the pcap package, or you did not install its development header files." >&5 --- 2993,2997 ---- if test $ac_pcap_header_dir = "none" ; then ! { { echo "$as_me:2995: error: I cannot find the pcap header file anywhere. Perhaps you did not install the pcap package, or you did not install its development header files." >&5 *************** *** 2956,2960 **** fi ! echo "$as_me:2958: result: $ac_pcap_header_dir" >&5 echo "${ECHO_T}$ac_pcap_header_dir" >&6 PCAP_INC="-I$ac_pcap_header_dir" --- 3002,3006 ---- fi ! echo "$as_me:3004: result: $ac_pcap_header_dir" >&5 echo "${ECHO_T}$ac_pcap_header_dir" >&6 PCAP_INC="-I$ac_pcap_header_dir" *************** *** 2973,2977 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 ! echo "$as_me:2975: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_DNET_PATH+set}" = set; then --- 3019,3023 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 ! echo "$as_me:3021: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_DNET_PATH+set}" = set; then *************** *** 2990,2994 **** if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_DNET_PATH="$ac_dir/$ac_word" ! echo "$as_me:2992: found $ac_dir/$ac_word" >&5 break fi --- 3036,3040 ---- if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_DNET_PATH="$ac_dir/$ac_word" ! echo "$as_me:3038: found $ac_dir/$ac_word" >&5 break fi *************** *** 3001,3008 **** if test -n "$DNET_PATH"; then ! echo "$as_me:3003: result: $DNET_PATH" >&5 echo "${ECHO_T}$DNET_PATH" >&6 else ! echo "$as_me:3006: result: no" >&5 echo "${ECHO_T}no" >&6 fi --- 3047,3054 ---- if test -n "$DNET_PATH"; then ! echo "$as_me:3049: result: $DNET_PATH" >&5 echo "${ECHO_T}$DNET_PATH" >&6 else ! echo "$as_me:3052: result: no" >&5 echo "${ECHO_T}no" >&6 fi *************** *** 3014,3018 **** if test $DNET_PATH = "no"; then ! echo "$as_me:3016: checking for eth_open in -ldnet" >&5 echo $ECHO_N "checking for eth_open in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_eth_open+set}" = set; then --- 3060,3064 ---- if test $DNET_PATH = "no"; then ! echo "$as_me:3062: checking for eth_open in -ldnet" >&5 echo $ECHO_N "checking for eth_open in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_eth_open+set}" = set; then *************** *** 3022,3026 **** LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF ! #line 3024 "configure" #include "confdefs.h" --- 3068,3072 ---- LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF ! #line 3070 "configure" #include "confdefs.h" *************** *** 3041,3054 **** _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:3043: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? ! echo "$as_me:3046: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:3049: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:3052: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_eth_open=yes --- 3087,3100 ---- _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:3089: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? ! echo "$as_me:3092: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:3095: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:3098: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_eth_open=yes *************** *** 3061,3070 **** LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:3063: result: $ac_cv_lib_dnet_eth_open" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_eth_open" >&6 if test $ac_cv_lib_dnet_eth_open = yes; then DNET_LIB="-ldnet" else ! { { echo "$as_me:3068: error: \`libdnet not found http://libdnet.sourceforge.net/ to get a copy'" >&5 echo "$as_me: error: \`libdnet not found http://libdnet.sourceforge.net/ to get a copy'" >&2;} { (exit 1); exit 1; }; } --- 3107,3116 ---- LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:3109: result: $ac_cv_lib_dnet_eth_open" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_eth_open" >&6 if test $ac_cv_lib_dnet_eth_open = yes; then DNET_LIB="-ldnet" else ! { { echo "$as_me:3114: error: \`libdnet not found http://libdnet.sourceforge.net/ to get a copy'" >&5 echo "$as_me: error: \`libdnet not found http://libdnet.sourceforge.net/ to get a copy'" >&2;} { (exit 1); exit 1; }; } *************** *** 3173,3177 **** ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" ! { echo "$as_me:3175: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF --- 3219,3223 ---- ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" ! { echo "$as_me:3221: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF *************** *** 3349,3353 **** --he | --h) # Conflict between --help and --header ! { { echo "$as_me:3351: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 --- 3395,3399 ---- --he | --h) # Conflict between --help and --header ! { { echo "$as_me:3397: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 *************** *** 3373,3382 **** # This is an error. ! -*) { { echo "$as_me:3375: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; ! *) { { echo "$as_me:3380: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; --- 3419,3428 ---- # This is an error. ! -*) { { echo "$as_me:3421: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; ! *) { { echo "$as_me:3426: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; *************** *** 3618,3622 **** if test x"$ac_file" != x-; then ! { echo "$as_me:3620: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" --- 3664,3668 ---- if test x"$ac_file" != x-; then ! { echo "$as_me:3666: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" *************** *** 3636,3640 **** [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3638: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3682,3686 ---- [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3684: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3649,3653 **** else # /dev/null tree ! { { echo "$as_me:3651: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3695,3699 ---- else # /dev/null tree ! { { echo "$as_me:3697: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3710,3714 **** esac ! test x"$ac_file" != x- && { echo "$as_me:3712: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} --- 3756,3760 ---- esac ! test x"$ac_file" != x- && { echo "$as_me:3758: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} *************** *** 3721,3725 **** [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3723: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3767,3771 ---- [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3769: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3734,3738 **** else # /dev/null tree ! { { echo "$as_me:3736: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3780,3784 ---- else # /dev/null tree ! { { echo "$as_me:3782: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3851,3855 **** if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then ! { echo "$as_me:3853: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else --- 3897,3901 ---- if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then ! { echo "$as_me:3899: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else Index: configure.in =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/configure.in,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** configure.in 15 Jun 2002 14:59:20 -0000 1.21 --- configure.in 23 Jun 2002 03:29:12 -0000 1.22 *************** *** 45,48 **** --- 45,49 ---- AC_WF_CHECK_KILL_SIGNAL_DETECT + AC_WF_CHECK_BPF_IMMEDIATE dnl check for types Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dhcp-client.c 18 Jun 2002 04:33:40 -0000 1.31 --- dhcp-client.c 23 Jun 2002 03:29:12 -0000 1.32 *************** *** 449,453 **** info_message(" "); ! while((c = getopt(argc, argv, "gcdavi:m:kwh:l:H:")) != -1) { switch(c) { --- 449,453 ---- info_message(" "); ! while((c = getopt(argc, argv, "pgcdavi:m:kwh:l:H:")) != -1) { switch(c) { Index: dhcp-net.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dhcp-net.c 22 Jun 2002 01:47:57 -0000 1.28 --- dhcp-net.c 23 Jun 2002 03:29:13 -0000 1.29 *************** *** 62,65 **** --- 62,69 ---- #include <dhcp-net.h> + #include <sys/ioctl.h> + #include <sys/uio.h> + #include <net/bpf.h> + /* get interface address. */ int rawnet_get_hw_addr(rawnet_t *net, eth_addr_t *addr) *************** *** 99,103 **** char errbuf[PCAP_ERRBUF_SIZE]; uint32_t mask = 0xffffffff; ! /* If interface not specificed get * a suitable one from pcap_lookupdev */ --- 103,112 ---- char errbuf[PCAP_ERRBUF_SIZE]; uint32_t mask = 0xffffffff; ! ! #if defined(HAVE_BPF_IMMEDIATE) ! int fd; ! u_int on = 1; ! #endif /* HAVE_BPF_IMMEDIATE */ ! /* If interface not specificed get * a suitable one from pcap_lookupdev */ *************** *** 129,138 **** error_message("rawnet: pcap_setfilter: %s", pcap_geterr(pcap)); return NULL; ! } pcap_freecode(&filter); ! /* All done setting up the device. */ return pcap; } --- 138,153 ---- error_message("rawnet: pcap_setfilter: %s", pcap_geterr(pcap)); return NULL; ! } pcap_freecode(&filter); ! #if defined(HAVE_BPF_IMMEDIATE) ! /* FreeBSD (others too?) need us to set the descriptor non ! * blocking and do a bogus read. This starts the timer. */ + fd = pcap_fileno(pcap); + ioctl(fd, BIOCIMMEDIATE, &on); + + #endif /* HAVE_BPF_IMMEDIATE */ return pcap; } *************** *** 357,372 **** */ ! int rawnet_get_packet(rawnet_t *net) { const unsigned char *packet; struct pcap_pkthdr pkthdr; int len; net->type = RAWNET_UNKNOWN; ! packet = pcap_next(net->pcap, &pkthdr); ! if(packet == NULL) { ! info_message("pcap_next: returned NULL"); ! return RAWNET_PCAP_ERROR; } --- 372,405 ---- */ ! int rawnet_get_packet(rawnet_t *net, struct timeval *tm) { const unsigned char *packet; struct pcap_pkthdr pkthdr; int len; + fd_set read_set; + int retval; net->type = RAWNET_UNKNOWN; ! while(1) { ! FD_ZERO(&read_set); ! FD_SET(net->pcap_fd, &read_set); ! ! retval = select((net->pcap_fd + 1), &read_set, NULL, NULL, tm); ! ! if(retval == 0) ! return RAWNET_TIMEOUT; ! ! if(retval < 0) ! return RAWNET_PCAP_ERROR; ! ! packet = pcap_next(net->pcap, &pkthdr); ! if(packet == NULL) ! continue; /* BPF may return 1 when there really isn't any packet for us. ! * is this because we're notified prior to filtering? ! * pcap only returns NULL on EWOULDBLOCK for bpf -- even though ! * in debugging I *never* get that errno value :| */ ! else ! break; } *************** *** 505,530 **** } - /* Wait for next packet. */ - - int rawnet_wait(rawnet_t *net, struct timeval *tm) - { - fd_set read_set; - int retval; - - FD_ZERO(&read_set); - FD_SET(net->pcap_fd, &read_set); - - retval = select((net->pcap_fd + 1), &read_set, NULL, NULL, tm); - - if(retval == 0) - return RAWNET_TIMEOUT; - - if(retval < 0) - return RAWNET_PCAP_ERROR; - - return RAWNET_OK; - - } - /* * We can ask rawnet to validate for us. --- 538,541 ---- *************** *** 588,592 **** timeout = rtt_get_timeout(rtt); ! retval = rawnet_wait(net, &timeout); switch(retval) { --- 599,603 ---- timeout = rtt_get_timeout(rtt); ! retval = rawnet_get_packet(net, &timeout); switch(retval) { *************** *** 613,618 **** case RAWNET_OK: - - rawnet_get_packet(net); if(!check) /* no check? return 0 anyway (we want --- 624,627 ---- *************** *** 629,634 **** break; default: ! error_message("rawnet: invalid return from rawnet_send_packet() -- this is a bug report it please"); break; } --- 638,647 ---- break; + case RAWNET_UNHANDLED: + case RAWNET_MALFORMED_PACKET: + break; + default: ! error_message("rawnet: invalid return from rawnet_get_packet() -- this is a bug report it please"); break; } Index: dhcp-net.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dhcp-net.h 22 Jun 2002 01:47:57 -0000 1.1 --- dhcp-net.h 23 Jun 2002 03:29:13 -0000 1.2 *************** *** 46,50 **** extern rawnet_t *rawnet_create(char *device, char *filter, int sport, int dport, int promiscuous); extern void rawnet_destroy(rawnet_t *net); ! extern int rawnet_get_packet(rawnet_t *net); extern int rawnet_get_hw_addr(rawnet_t *net, eth_addr_t *addr); extern int rawnet_get_real_hw_addr(rawnet_t *net, eth_addr_t *addr); --- 46,50 ---- extern rawnet_t *rawnet_create(char *device, char *filter, int sport, int dport, int promiscuous); extern void rawnet_destroy(rawnet_t *net); ! extern int rawnet_get_packet(rawnet_t *net, struct timeval *tm); extern int rawnet_get_hw_addr(rawnet_t *net, eth_addr_t *addr); extern int rawnet_get_real_hw_addr(rawnet_t *net, eth_addr_t *addr); *************** *** 67,71 **** extern void rawnet_dhcp_update(rawnet_t *net, time_t seconds); - extern int rawnet_wait(rawnet_t *net, struct timeval *tm); extern int rawnet_is_dhcp_offer(rawnet_t *net); extern int rawnet_is_valid(rawnet_t *net); --- 67,70 ---- Index: dhcp-sniff.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sniff.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dhcp-sniff.c 22 Jun 2002 02:12:03 -0000 1.12 --- dhcp-sniff.c 23 Jun 2002 03:29:13 -0000 1.13 *************** *** 126,131 **** while(1) { ! rawnet_wait(net, NULL); ! retval = rawnet_get_packet(net); switch(retval) { --- 126,130 ---- while(1) { ! retval = rawnet_get_packet(net, NULL); switch(retval) { |