]> The Tcpdump Group git mirrors - libpcap/commitdiff
airpcap: don't treat the absence of airpcap.dll as an error.
authorGuy Harris <[email protected]>
Thu, 25 Feb 2021 18:49:30 +0000 (10:49 -0800)
committerGuy Harris <[email protected]>
Thu, 25 Feb 2021 19:00:05 +0000 (11:00 -0800)
Most users probably won't have it installed, so treat its absence as an
indication that they don't have an AirPcap device.

(cherry picked from commit 925f4d4987ee9b221a97596b5b998a81df5d6f0a)

pcap-airpcap.c

index 703f23acfc7f36d78178bb7eeff1fad19407096d..d986ad9c39bcb37d273871c17b2527dfa34519a2 100644 (file)
@@ -158,7 +158,7 @@ load_airpcap_functions(void)
         *      AIRPCAP_API_LOADING, in which case *we're* the
         *      ones loading it, and should now try to do so.
         */
-       if (current_status  == AIRPCAP_API_LOADED)
+       if (current_status == AIRPCAP_API_LOADED)
                return AIRPCAP_API_LOADED;
 
        if (current_status == AIRPCAP_API_CANNOT_LOAD)
@@ -974,7 +974,14 @@ airpcap_create(const char *device, char *ebuf, int *is_ours)
         * so do so if we haven't already tried to do so.
         */
        if (load_airpcap_functions() != AIRPCAP_API_LOADED) {
-               snprintf(ebuf, PCAP_ERRBUF_SIZE, "Couldn't load AirPcap DLL\n");
+               /*
+                * We assume this means that we don't have the AirPcap
+                * software installed, which probably means we don't
+                * have an AirPcap device.
+                *
+                * Don't treat that as an error.
+                */
+               *is_ours = 0;
                return (NULL);
        }