Daniel Borkmann wrote:
> Thanks Robert! I suspect there's some quirk in the kernel's TPACKET_V3
> implementation, so far I was too busy with other work that I haven't come
> around to look into that code part. It would not make sense from a user's
> point of view imho that he would need to flush stuff on exit as the kernel
> should take care of this, I think we didn't have any issue on TPACKET_V2
> so far. I think there's something odd with TPACKET_V3 stats anyway, that's
> why we do them on our own.
Ah, OK. Note that, if I understand things correctly, the change below
only hides the problem by periodically pulling packets from the capture
ring during the capture, I don't think it actually does a final flush of
the ring once netsniff-ng has been signalled to shut down.
> >diff --git a/netsniff-ng.c b/netsniff-ng.c
> >index c5966b1..c00078c 100644
> >--- a/netsniff-ng.c
> >+++ b/netsniff-ng.c
> >@@ -981,7 +981,7 @@ static void recv_only_or_dump(struct ctx *ctx)
> > break;
> > }
> >
> >- ret = poll(&rx_poll, 1, -1);
> >+ ret = poll(&rx_poll, 1, 1000);
> > if (unlikely(ret < 0)) {
> > if (errno != EINTR)
> > panic("Poll failed!\n");
> >
--
Robert Edmonds
--
You received this message because you are subscribed to the Google Groups
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.