ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 8a2d95655435708c8b4ed442cd0c56ac1343882c
parent 575a7bc4e2b864e7bd5db8caffe43705787ba2e6
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Fri, 13 Jun 2014 13:45:45 -0700

Emit the active BPF filter when reading PCAP dumps

Diffstat:
Mngrep.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -436,9 +436,9 @@ int main(int argc, char **argv) { } } else { - char *default_filter = BPF_FILTER_IP; + filter = strdup(BPF_FILTER_IP); - if (pcap_compile(pd, &pcapfilter, default_filter, 0, mask.s_addr)) { + if (pcap_compile(pd, &pcapfilter, filter, 0, mask.s_addr)) { pcap_perror(pd, "pcap compile"); clean_exit(-1); }