[Dhcp-agent-commits] CVS: dhcp-agent configure,1.12,1.13 configure.in,1.14,1.15 dhcp-agent.h,1.43,1.
Status: Alpha
Brought to you by:
actmodern
From: Thamer Al-H. <act...@us...> - 2002-06-03 22:40:36
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv18662 Modified Files: configure configure.in dhcp-agent.h dhcp-net.c dhcp-sniff.c Log Message: possible fix for pcap-bpf problem which causes pcap_next to return NULL Index: configure =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/configure,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** configure 3 Jun 2002 01:36:04 -0000 1.12 --- configure 3 Jun 2002 22:40:32 -0000 1.13 *************** *** 2526,2529 **** --- 2526,2532 ---- #line 2526 "configure" #include "confdefs.h" + #include <sys/types> + #include <sys/time.h> + #include <sys/ioctl.h> #include <net/bpf.h> *************** *** 2540,2553 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2542: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2545: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2548: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2551: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_struct_bpf_timeval=yes --- 2543,2556 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2545: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2548: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2551: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2554: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_struct_bpf_timeval=yes *************** *** 2559,2563 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2561: 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 --- 2562,2566 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2564: 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 *************** *** 2568,2572 **** fi ! echo "$as_me:2570: 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 --- 2571,2575 ---- fi ! echo "$as_me:2573: 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 *************** *** 2574,2578 **** else cat >conftest.$ac_ext <<_ACEOF ! #line 2576 "configure" #include "confdefs.h" #include <signal.h> --- 2577,2581 ---- else cat >conftest.$ac_ext <<_ACEOF ! #line 2579 "configure" #include "confdefs.h" #include <signal.h> *************** *** 2590,2603 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2592: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2595: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2598: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2601: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_sig_atomic_t=yes --- 2593,2606 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2595: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2598: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2601: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2604: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_sig_atomic_t=yes *************** *** 2609,2613 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2611: 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 --- 2612,2616 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2614: 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 *************** *** 2618,2622 **** fi ! echo "$as_me:2620: 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 --- 2621,2625 ---- fi ! echo "$as_me:2623: 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 *************** *** 2624,2628 **** else cat >conftest.$ac_ext <<_ACEOF ! #line 2626 "configure" #include "confdefs.h" #include <sys/types.h> --- 2627,2631 ---- else cat >conftest.$ac_ext <<_ACEOF ! #line 2629 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2646,2659 **** _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2648: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2651: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2654: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2657: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void --- 2649,2662 ---- _ACEOF rm -f conftest.$ac_objext ! if { (eval echo "$as_me:2651: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? ! echo "$as_me:2654: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' ! { (eval echo "$as_me:2657: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2660: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void *************** *** 2665,2669 **** rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2667: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 --- 2668,2672 ---- rm -f conftest.$ac_objext conftest.$ac_ext fi ! echo "$as_me:2670: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 *************** *** 2674,2678 **** if test -z "$pcap_prefix"; then ! echo "$as_me:2676: checking for pcap library directory" >&5 echo $ECHO_N "checking for pcap library directory... $ECHO_C" >&6 ac_pcap_lib_dir="none" --- 2677,2681 ---- if test -z "$pcap_prefix"; then ! echo "$as_me:2679: checking for pcap library directory" >&5 echo $ECHO_N "checking for pcap library directory... $ECHO_C" >&6 ac_pcap_lib_dir="none" *************** *** 2685,2689 **** if test $ac_pcap_lib_dir = "none" ; then ! { { echo "$as_me:2687: 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 --- 2688,2692 ---- if test $ac_pcap_lib_dir = "none" ; then ! { { echo "$as_me:2690: 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 *************** *** 2694,2702 **** fi ! echo "$as_me:2696: 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:2700: checking for pcap header directory" >&5 echo $ECHO_N "checking for pcap header directory... $ECHO_C" >&6 ac_pcap_header_dir="none" --- 2697,2705 ---- fi ! echo "$as_me:2699: 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:2703: checking for pcap header directory" >&5 echo $ECHO_N "checking for pcap header directory... $ECHO_C" >&6 ac_pcap_header_dir="none" *************** *** 2709,2713 **** if test $ac_pcap_header_dir = "none" ; then ! { { echo "$as_me:2711: 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 --- 2712,2716 ---- if test $ac_pcap_header_dir = "none" ; then ! { { echo "$as_me:2714: 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 *************** *** 2718,2722 **** fi ! echo "$as_me:2720: result: $ac_pcap_header_dir" >&5 echo "${ECHO_T}$ac_pcap_header_dir" >&6 PCAP_INC="-I$ac_pcap_header_dir" --- 2721,2725 ---- fi ! echo "$as_me:2723: result: $ac_pcap_header_dir" >&5 echo "${ECHO_T}$ac_pcap_header_dir" >&6 PCAP_INC="-I$ac_pcap_header_dir" *************** *** 2735,2739 **** # 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:2737: 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 --- 2738,2742 ---- # 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:2740: 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 *************** *** 2752,2756 **** if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_DNET_PATH="$ac_dir/$ac_word" ! echo "$as_me:2754: found $ac_dir/$ac_word" >&5 break fi --- 2755,2759 ---- if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_DNET_PATH="$ac_dir/$ac_word" ! echo "$as_me:2757: found $ac_dir/$ac_word" >&5 break fi *************** *** 2763,2770 **** if test -n "$DNET_PATH"; then ! echo "$as_me:2765: result: $DNET_PATH" >&5 echo "${ECHO_T}$DNET_PATH" >&6 else ! echo "$as_me:2768: result: no" >&5 echo "${ECHO_T}no" >&6 fi --- 2766,2773 ---- if test -n "$DNET_PATH"; then ! echo "$as_me:2768: result: $DNET_PATH" >&5 echo "${ECHO_T}$DNET_PATH" >&6 else ! echo "$as_me:2771: result: no" >&5 echo "${ECHO_T}no" >&6 fi *************** *** 2776,2780 **** if test $DNET_PATH = "no"; then ! echo "$as_me:2778: 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 --- 2779,2783 ---- if test $DNET_PATH = "no"; then ! echo "$as_me:2781: 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 *************** *** 2784,2788 **** LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF ! #line 2786 "configure" #include "confdefs.h" --- 2787,2791 ---- LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF ! #line 2789 "configure" #include "confdefs.h" *************** *** 2803,2816 **** _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:2805: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? ! echo "$as_me:2808: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:2811: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2814: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_eth_open=yes --- 2806,2819 ---- _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:2808: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? ! echo "$as_me:2811: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:2814: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? ! echo "$as_me:2817: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_eth_open=yes *************** *** 2823,2832 **** LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:2825: 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:2830: 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; }; } --- 2826,2835 ---- LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:2828: 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:2833: 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; }; } *************** *** 2935,2939 **** ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" ! { echo "$as_me:2937: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF --- 2938,2942 ---- ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" ! { echo "$as_me:2940: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF *************** *** 3111,3115 **** --he | --h) # Conflict between --help and --header ! { { echo "$as_me:3113: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 --- 3114,3118 ---- --he | --h) # Conflict between --help and --header ! { { echo "$as_me:3116: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 *************** *** 3135,3144 **** # This is an error. ! -*) { { echo "$as_me:3137: 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:3142: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; --- 3138,3147 ---- # This is an error. ! -*) { { echo "$as_me:3140: 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:3145: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; *************** *** 3381,3385 **** if test x"$ac_file" != x-; then ! { echo "$as_me:3383: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" --- 3384,3388 ---- if test x"$ac_file" != x-; then ! { echo "$as_me:3386: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" *************** *** 3399,3403 **** [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3401: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3402,3406 ---- [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3404: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3412,3416 **** else # /dev/null tree ! { { echo "$as_me:3414: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3415,3419 ---- else # /dev/null tree ! { { echo "$as_me:3417: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3473,3477 **** esac ! test x"$ac_file" != x- && { echo "$as_me:3475: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} --- 3476,3480 ---- esac ! test x"$ac_file" != x- && { echo "$as_me:3478: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} *************** *** 3484,3488 **** [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3486: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3487,3491 ---- [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) ! test -f "$f" || { { echo "$as_me:3489: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3497,3501 **** else # /dev/null tree ! { { echo "$as_me:3499: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } --- 3500,3504 ---- else # /dev/null tree ! { { echo "$as_me:3502: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } *************** *** 3614,3618 **** if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then ! { echo "$as_me:3616: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else --- 3617,3621 ---- if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then ! { echo "$as_me:3619: $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.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** configure.in 3 Jun 2002 01:36:04 -0000 1.14 --- configure.in 3 Jun 2002 22:40:32 -0000 1.15 *************** *** 41,45 **** dnl check for types ! AC_CHECK_TYPE(struct bpf_timeval, [AC_DEFINE(HAVE_BPF_TIMEVAL)], [], [#include <net/bpf.h>]) AC_CHECK_TYPE(sig_atomic_t, [AC_DEFINE(HAVE_SIG_ATOMIC_T)], [], [#include <signal.h>]) AC_TYPE_SIGNAL --- 41,50 ---- dnl check for types ! AC_CHECK_TYPE(struct bpf_timeval, [AC_DEFINE(HAVE_BPF_TIMEVAL)], [], ! [#include <sys/types> ! #include <sys/time.h> ! #include <sys/ioctl.h> ! #include <net/bpf.h> ]) ! AC_CHECK_TYPE(sig_atomic_t, [AC_DEFINE(HAVE_SIG_ATOMIC_T)], [], [#include <signal.h>]) AC_TYPE_SIGNAL Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** dhcp-agent.h 3 Jun 2002 01:36:04 -0000 1.43 --- dhcp-agent.h 3 Jun 2002 22:40:32 -0000 1.44 *************** *** 497,501 **** 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); --- 497,501 ---- 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); Index: dhcp-net.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dhcp-net.c 30 May 2002 06:44:05 -0000 1.22 --- dhcp-net.c 3 Jun 2002 22:40:32 -0000 1.23 *************** *** 407,412 **** packet = pcap_next(net->pcap, &pkthdr); ! if(packet == NULL) return RAWNET_PCAP_ERROR; /* Set timestamp. */ --- 407,414 ---- packet = pcap_next(net->pcap, &pkthdr); ! if(packet == NULL) { ! info_message("pcap_next: returned NULL"); return RAWNET_PCAP_ERROR; + } /* Set timestamp. */ *************** *** 524,528 **** /* Wait for next packet. */ ! int rawnet_wait(rawnet_t *net, struct timeval tm) { fd_set read_set; --- 526,530 ---- /* Wait for next packet. */ ! int rawnet_wait(rawnet_t *net, struct timeval *tm) { fd_set read_set; *************** *** 532,536 **** FD_SET(net->pcap_fd, &read_set); ! retval = select((net->pcap_fd + 1), &read_set, NULL, NULL, &tm); if(retval == 0) --- 534,538 ---- FD_SET(net->pcap_fd, &read_set); ! retval = select((net->pcap_fd + 1), &read_set, NULL, NULL, tm); if(retval == 0) *************** *** 540,544 **** return RAWNET_PCAP_ERROR; ! return 0; } --- 542,546 ---- return RAWNET_PCAP_ERROR; ! return RAWNET_OK; } *************** *** 582,585 **** --- 584,588 ---- int retval; unsigned char send_packet = 1; + struct timeval timeout; /* create rtt mechanism. */ *************** *** 603,607 **** } ! retval = rawnet_wait(net, rtt_get_timeout(rtt)); switch(retval) { --- 606,611 ---- } ! timeout = rtt_get_timeout(rtt); ! retval = rawnet_wait(net, &timeout); switch(retval) { Index: dhcp-sniff.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sniff.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-sniff.c 16 Feb 2002 17:54:33 -0000 1.6 --- dhcp-sniff.c 3 Jun 2002 22:40:32 -0000 1.7 *************** *** 90,94 **** while(1) { ! retval = rawnet_get_packet(net); --- 90,95 ---- while(1) { ! ! rawnet_wait(net, NULL); retval = rawnet_get_packet(net); |