From 2fd233b16d6fd907d707877c9c18f7e6bd0edfaf Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 10 Jan 2010 00:32:13 -0800 Subject: On Linux, always at least try to scan /proc/net/dev. If we fail to open it, we just drive on, so it's not a fatal error; yes, it'll slow us down a little, but it's probably not much, and most Linux kernels probably have it in any case. --- config.h.in | 3 --- configure | 17 ----------------- configure.in | 11 ----------- pcap-linux.c | 4 ---- 4 files changed, 35 deletions(-) diff --git a/config.h.in b/config.h.in index 3a8a2a7..990091d 100644 --- a/config.h.in +++ b/config.h.in @@ -88,9 +88,6 @@ /* define if net/pfvar.h defines PF_NAT through PF_NORDR */ #undef HAVE_PF_NAT_THROUGH_PF_NORDR -/* define if you have a /proc/net/dev */ -#undef HAVE_PROC_NET_DEV - /* define if you have a Septel API */ #undef HAVE_SEPTEL_API diff --git a/configure b/configure index 9a4fbb7..961024d 100755 --- a/configure +++ b/configure @@ -8497,23 +8497,6 @@ fi { echo "$as_me:$LINENO: result: ${enable_yydebug-no}" >&5 echo "${ECHO_T}${enable_yydebug-no}" >&6; } -{ echo "$as_me:$LINENO: checking whether we have /proc/net/dev" >&5 -echo $ECHO_N "checking whether we have /proc/net/dev... $ECHO_C" >&6; } -if test -r /proc/net/dev ; then - ac_cv_lbl_proc_net_dev=yes -else - ac_cv_lbl_proc_net_dev=no -fi -if test $ac_cv_lbl_proc_net_dev = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PROC_NET_DEV 1 -_ACEOF - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lbl_proc_net_dev" >&5 -echo "${ECHO_T}$ac_cv_lbl_proc_net_dev" >&6; } - # Check for Endace DAG card support. # Check whether --with-dag was given. diff --git a/configure.in b/configure.in index e3904f9..a0e5973 100644 --- a/configure.in +++ b/configure.in @@ -641,17 +641,6 @@ if test "$enable_yydebug" = "yes"; then fi AC_MSG_RESULT(${enable_yydebug-no}) -AC_MSG_CHECKING(whether we have /proc/net/dev) -if test -r /proc/net/dev ; then - ac_cv_lbl_proc_net_dev=yes -else - ac_cv_lbl_proc_net_dev=no -fi -if test $ac_cv_lbl_proc_net_dev = yes; then - AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev]) -fi -AC_MSG_RESULT($ac_cv_lbl_proc_net_dev) - # Check for Endace DAG card support. AC_ARG_WITH([dag], AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]), diff --git a/pcap-linux.c b/pcap-linux.c index 344917d..b502821 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -1775,7 +1775,6 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats) return 0; } -#ifdef HAVE_PROC_NET_DEV /* * Get from "/proc/net/dev" all interfaces listed there; if they're * already in the list of interfaces we have, that won't add another @@ -1915,7 +1914,6 @@ scan_proc_net_dev(pcap_if_t **devlistp, char *errbuf) (void)fclose(proc_net_f); return (ret); } -#endif /* HAVE_PROC_NET_DEV */ /* * Description string for the "any" device. @@ -1925,7 +1923,6 @@ static const char any_descr[] = "Pseudo-device that captures on all interfaces"; int pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) { -#ifdef HAVE_PROC_NET_DEV /* * Read "/proc/net/dev", and add to the list of interfaces all * interfaces listed there that we don't already have, because, @@ -1936,7 +1933,6 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) */ if (scan_proc_net_dev(alldevsp, errbuf) == -1) return (-1); -#endif /* * Add the "any" device. -- cgit v1.2.3