]> The Tcpdump Group git mirrors - libpcap/commitdiff
On Linux, always at least try to scan /proc/net/dev.
authorGuy Harris <[email protected]>
Sun, 10 Jan 2010 08:32:13 +0000 (00:32 -0800)
committerGuy Harris <[email protected]>
Sun, 10 Jan 2010 08:32:13 +0000 (00:32 -0800)
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
configure
configure.in
pcap-linux.c

index 3a8a2a7c81e9ec36bc69180cd728ec4ce011fd46..990091d17ea30ffe763da5d551d0403598a6752c 100644 (file)
@@ -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
 
index 9a4fbb7236b3d5193153d5adc12c265a2794c9f5..961024dce97631e6471f22ca329229256b7a3356 100755 (executable)
--- 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.
index e3904f96accfe94841925ec166cb28e06be4f556..a0e5973db01e456dd4bb963a7104f3506f42a87f 100644 (file)
@@ -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@:>@]),
index 344917d2596964fd0fb5c4117945b4fbda468947..b502821f543a02d4c145acf6969e4579deb5f2ad 100644 (file)
@@ -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.