From: Guy Harris Date: Sun, 13 Jan 2019 23:04:22 +0000 (-0800) Subject: Handle older OSes without DLT_PRISM_HEADER/DLT_AIRONET_HEADER/DLT_PPI. X-Git-Tag: libpcap-1.10-bp~611 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/f0363d0cb7fc0e66ac9eac1b6512efe92fce89c5 Handle older OSes without DLT_PRISM_HEADER/DLT_AIRONET_HEADER/DLT_PPI. Check whether they're defined before using them. --- diff --git a/pcap-bpf.c b/pcap-bpf.c index 3ad7fafb..6fe2eaf5 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -3049,8 +3049,12 @@ find_802_11(struct bpf_dltlist *bdlp) new_dlt = bdlp->bfl_list[i]; break; +#ifdef DLT_PRISM_HEADER case DLT_PRISM_HEADER: +#endif +#ifdef DLT_AIRONET_HEADER case DLT_AIRONET_HEADER: +#endif case DLT_IEEE802_11_RADIO_AVS: /* * 802.11 with radio, but not radiotap. @@ -3145,11 +3149,17 @@ remove_802_11(pcap_t *p) switch (p->dlt_list[i]) { case DLT_IEEE802_11: +#ifdef DLT_PRISM_HEADER case DLT_PRISM_HEADER: +#endif +#ifdef DLT_AIRONET_HEADER case DLT_AIRONET_HEADER: +#endif case DLT_IEEE802_11_RADIO: case DLT_IEEE802_11_RADIO_AVS: +#ifdef DLT_PPI case DLT_PPI: +#endif /* * 802.11. Don't offer this one. */