X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/51166947eea5867eab23960ba3abad06f70334c8..8d3c2ed39e1b365da42c3aa5d2c5d6a6a5796bac:/tcpdump.c diff --git a/tcpdump.c b/tcpdump.c index 5e0afd24..06d3d9b9 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -1932,6 +1932,14 @@ main(int argc, char **argv) show_remote_devices_and_exit(); #endif +#if defined(DLT_LINUX_SLL2) && defined(HAVE_PCAP_SET_DATALINK) +/* Set default linktype DLT_LINUX_SLL2 when capturing on the "any" device */ + if (device != NULL && + strncmp (device, "any", strlen("any")) == 0 + && yflag_dlt == -1) + yflag_dlt = DLT_LINUX_SLL2; +#endif + switch (ndo->ndo_tflag) { case 0: /* Default */ @@ -2180,7 +2188,8 @@ main(int argc, char **argv) } #endif (void)fprintf(stderr, "%s: data link type %s\n", - program_name, yflag_dlt_name); + program_name, + pcap_datalink_val_to_name(yflag_dlt)); (void)fflush(stderr); } i = pcap_snapshot(pd); @@ -2461,7 +2470,7 @@ DIAG_ON_CLANG(assign-enum) */ if (!ndo->ndo_vflag && !WFileName) { (void)fprintf(stderr, - "%s: verbose output suppressed, use -v or -vv for full protocol decode\n", + "%s: verbose output suppressed, use -v[v]... for full protocol decode\n", program_name); } else (void)fprintf(stderr, "%s: ", program_name);