X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/2a85a1bba4c2e63094a259c5d0ed397f234ba5f3..refs/pull/482/head:/tcpdump.c diff --git a/tcpdump.c b/tcpdump.c index ca46638e..a0c627c6 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -1291,7 +1291,12 @@ main(int argc, char **argv) * We're doing a live capture. */ if (device == NULL) { +#ifdef HAVE_PCAP_FINDALLDEVS + if (pcap_findalldevs(&devpointer, ebuf) >= 0 && devpointer != NULL) + device = devpointer->name; +#else /* HAVE_PCAP_FINDALLDEVS */ device = pcap_lookupdev(ebuf); +#endif if (device == NULL) error("%s", ebuf); }