From cfb5ccffe3209c04c77111cc5c3f9d069107bb62 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 3 Jul 2020 10:58:37 -0700 Subject: NPF: revert aaddition of "accept all" filter. That wasn't tested and wasn't ready to be committed; 6c893c132cbf8a8b1f9acfe909a45bfee230ba81 was supposted to change only testprogs/writecaptest.c. --- pcap-npf.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'pcap-npf.c') diff --git a/pcap-npf.c b/pcap-npf.c index 06f6bba0..2c7fd9f5 100644 --- a/pcap-npf.c +++ b/pcap-npf.c @@ -908,8 +908,6 @@ pcap_activate_npf(pcap_t *p) NetType type; int res; int status = 0; - struct bpf_insn total_insn; - struct bpf_program total_prog; if (p->opt.rfmon) { /* @@ -1233,29 +1231,6 @@ pcap_activate_npf(pcap_t *p) #endif /* HAVE_DAG_API */ } - /* - * If there's no filter program installed, there's - * no indication to the kernel of what the snapshot - * length should be, so no snapshotting is done. - * - * Therefore, when we open the device, we install - * an "accept everything" filter with the specified - * snapshot length. - */ - total_insn.code = (u_short)(BPF_RET | BPF_K); - total_insn.jt = 0; - total_insn.jf = 0; - total_insn.k = p->snapshot; - - total_prog.bf_len = 1; - total_prog.bf_insns = &total_insn; - if (!PacketSetBpf(pw->adapter, &total_prog)) { - pcap_fmt_errmsg_for_win32_err(p->errbuf, PCAP_ERRBUF_SIZE, - GetLastError(), "PacketSetBpf"); - status = PCAP_ERROR; - goto bad; - } - PacketSetReadTimeout(pw->adapter, p->opt.timeout); /* disable loopback capture if requested */ -- cgit v1.2.1