[netsniff-ng] [PATCH] netsniff-ng: skip duplicated packets on loopback device

2016-07-21 Thread Paolo Abeni
When sniffing on the loopback device, each packet will be seen twice, once per direction. To avoid duplicates, explicitly skip OUTGOING packets received from loopback, if no packet_type filter is explicitly set. Signed-off-by: Paolo Abeni --- netsniff-ng.c | 32

Re: [netsniff-ng] packet accounting in netsniff-ng

2016-07-21 Thread Tobias Klauser
On 2016-07-21 at 16:01:30 +0200, Paolo Abeni wrote: > Hi all, > > I have a couple of doubts about packet accounting in netsniff-ng: > currently in receive_to_xmit() pkts_seen is incremented before the > packet type check, but failing the latter will cause the packet to be >

Re: [netsniff-ng] [PATCH] netsniff-ng: increment the pkts_seen after packet type check

2016-07-21 Thread Tobias Klauser
On 2016-07-21 at 16:42:22 +0200, Paolo Abeni wrote: > Currently in receive_to_xmit() pkts_seen is incremented before > after the packet type check, but failing the latter will cause > the packet to be ignored, pretty much as if it failed to pass > the filter. > This change move

Re: [netsniff-ng] [PATCH] netsniff-ng: skip duplicated packets on loopback device

2016-07-21 Thread Tobias Klauser
On 2016-07-21 at 15:25:27 +0200, Paolo Abeni wrote: > When sniffing on the loopback device, each packet will be seen > twice, once per direction. To avoid duplicates, explicitly > skip OUTGOING packets received from loopback, if no packet_type > filter is explicitly set. > >

[netsniff-ng] packet accounting in netsniff-ng

2016-07-21 Thread Paolo Abeni
Hi all, I have a couple of doubts about packet accounting in netsniff-ng: currently in receive_to_xmit() pkts_seen is incremented before the packet type check, but failing the latter will cause the packet to be ignored, pretty much as if it failed to pass the filter. In walk_t3_block() and