summaryrefslogtreecommitdiff
path: root/netsniff-ng.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-04-22 19:26:11 +0300
committerTobias Klauser <tklauser@distanz.ch>2015-04-22 21:58:21 +0200
commit56d79391b748563cc5075b9d31fe199db8a2d093 (patch)
tree9718b110636556ac844637009e71606e61182eec /netsniff-ng.c
parentc69c838def37d46008e85fdc2f817fc9fd70c4d5 (diff)
netsniff-ng: Don't set IO prio when reading pcap file
It allows to read pcap file for users who have no permissions to set process IO prio. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Acked-by: Daniel Borkmann <borkmann@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'netsniff-ng.c')
-rw-r--r--netsniff-ng.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/netsniff-ng.c b/netsniff-ng.c
index 4ad8b19..ee9dc38 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -228,7 +228,7 @@ static void pcap_to_xmit(struct ctx *ctx)
}
if (__pcap_io->init_once_pcap)
- __pcap_io->init_once_pcap();
+ __pcap_io->init_once_pcap(true);
ret = __pcap_io->pull_fhdr_pcap(fd, &ctx->magic, &ctx->link_type);
if (ret)
@@ -567,7 +567,7 @@ static void read_pcap(struct ctx *ctx)
}
if (__pcap_io->init_once_pcap)
- __pcap_io->init_once_pcap();
+ __pcap_io->init_once_pcap(false);
ret = __pcap_io->pull_fhdr_pcap(fd, &ctx->magic, &ctx->link_type);
if (ret)
@@ -963,7 +963,7 @@ static void recv_only_or_dump(struct ctx *ctx)
ifflags = device_enter_promiscuous_mode(ctx->device_in);
if (dump_to_pcap(ctx) && __pcap_io->init_once_pcap)
- __pcap_io->init_once_pcap();
+ __pcap_io->init_once_pcap(true);
drop_privileges(ctx->enforce, ctx->uid, ctx->gid);