From: Guy Harris Date: Tue, 15 Mar 2022 02:13:16 +0000 (-0700) Subject: bpf: fix error check. X-Git-Tag: libpcap-1.10.2~203 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/a62db481c1eda725cf51b0ca991c8fea70df7b70?ds=sidebyside bpf: fix error check. The status of the bpf_bind() call, which is what might equal BPF_BIND_BUFFER_TOO_BIG, is in status, not errno. (cherry picked from commit b9428e2c4bcb4d8509a65b6fc9a4cb2ab23f3d1e) --- diff --git a/pcap-bpf.c b/pcap-bpf.c index 7a0c2ffe..d82ecd05 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -2200,7 +2200,7 @@ pcap_activate_bpf(pcap_t *p) * * Otherwise, fail. */ - if (errno != BPF_BIND_BUFFER_TOO_BIG) { + if (status != BPF_BIND_BUFFER_TOO_BIG) { /* * Special checks on macOS to deal * with the way monitor mode was