dect
/
libpcap
Archived
13
0
Fork 0

Don't check for DLT_IPNET if it's not defined - in pcap-bpf.c, the bpf.h

we're using is the OS's, not libpcap's, so it's not necessarily defined.

Explain why we're checking for DLT_IPNET.
This commit is contained in:
Guy Harris 2009-11-25 12:02:06 -08:00
parent 272bbe3dfe
commit b8c57c9529
1 changed files with 10 additions and 2 deletions

View File

@ -539,12 +539,20 @@ get_dlt_list(int fd, int v, struct bpf_dltlist *bdlp, char *ebuf)
* right thing to do, but I suspect it is - Ethernet <->
* 802.11 bridges would probably badly mishandle frames
* that don't have Ethernet headers).
*
* On Solaris with BPF, Ethernet devices also offer
* DLT_IPNET, so we, if DLT_IPNET is defined, we don't
* treat it as an indication that the device isn't an
* Ethernet.
*/
if (v == DLT_EN10MB) {
is_ethernet = 1;
for (i = 0; i < bdlp->bfl_len; i++) {
if (bdlp->bfl_list[i] != DLT_EN10MB &&
bdlp->bfl_list[i] != DLT_IPNET) {
if (bdlp->bfl_list[i] != DLT_EN10MB
#ifdef DLT_IPNET
&& bdlp->bfl_list[i] != DLT_IPNET
#endif
) {
is_ethernet = 0;
break;
}