[netsniff-ng] Re: [PATCH 2/5] flowtop: Allow disable hostname lookup

2015-10-27 Thread Tobias Klauser
On 2015-10-27 at 01:00:48 +0100, Vadim Kochan  wrote:
> Added option -n,--no-dns which disables hostname lookup.
> 
> Signed-off-by: Vadim Kochan 

Applied, thanks.

-- 
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 netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] Re: [PATCH 1/5] flowtop: Fix src hostname showed with garbage

2015-10-27 Thread vkochan
On Tue, Oct 27, 2015 at 10:51:26AM +0100, Tobias Klauser wrote:
> On 2015-10-27 at 01:00:47 +0100, Vadim Kochan  wrote:
> > Use strlcpy for copy resolved src/dst hostname.
> > 
> > Signed-off-by: Vadim Kochan 
> > ---
> >  flowtop.c | 9 +++--
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> > 
> > diff --git a/flowtop.c b/flowtop.c
> > index cfe76d5..50064bb 100644
> > --- a/flowtop.c
> > +++ b/flowtop.c
> > @@ -730,12 +730,9 @@ static void flow_entry_get_extended_revdns(struct 
> > flow_entry *n,
> > getnameinfo(sa, sa_len, SELFLD(dir, rev_dns_src, rev_dns_dst),
> > sizeof(n->rev_dns_src), NULL, 0, NI_NUMERICHOST);
> >  
> > -   if (hent) {
> > -   memset(n->rev_dns_dst, 0, sizeof(n->rev_dns_dst));
> > -   memcpy(SELFLD(dir, rev_dns_src, rev_dns_dst),
> > -  hent->h_name, min(sizeof(n->rev_dns_src),
> > -strlen(hent->h_name)));
> > -   }
> > +   if (hent)
> > +   strlcpy(SELFLD(dir, rev_dns_src, rev_dns_dst), hent->h_name,
> > +   min(sizeof(n->rev_dns_src), strlen(hent->h_name) + 1));
> 
> Just use sizeof(n->rev_dns_src) as the size argument here instead of the
> min(), strlcpy will take care of the rest.

OK, yeah, sorry for such stupid mistakes ...

-- 
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 netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] Re: [PATCH 1/5] flowtop: Fix src hostname showed with garbage

2015-10-27 Thread Tobias Klauser
On 2015-10-27 at 10:59:10 +0100, vkochan  wrote:
> On Tue, Oct 27, 2015 at 10:51:26AM +0100, Tobias Klauser wrote:
> > On 2015-10-27 at 01:00:47 +0100, Vadim Kochan  wrote:
> > > Use strlcpy for copy resolved src/dst hostname.
> > > 
> > > Signed-off-by: Vadim Kochan 
> > > ---
> > >  flowtop.c | 9 +++--
> > >  1 file changed, 3 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/flowtop.c b/flowtop.c
> > > index cfe76d5..50064bb 100644
> > > --- a/flowtop.c
> > > +++ b/flowtop.c
> > > @@ -730,12 +730,9 @@ static void flow_entry_get_extended_revdns(struct 
> > > flow_entry *n,
> > >   getnameinfo(sa, sa_len, SELFLD(dir, rev_dns_src, rev_dns_dst),
> > >   sizeof(n->rev_dns_src), NULL, 0, NI_NUMERICHOST);
> > >  
> > > - if (hent) {
> > > - memset(n->rev_dns_dst, 0, sizeof(n->rev_dns_dst));
> > > - memcpy(SELFLD(dir, rev_dns_src, rev_dns_dst),
> > > -hent->h_name, min(sizeof(n->rev_dns_src),
> > > -  strlen(hent->h_name)));
> > > - }
> > > + if (hent)
> > > + strlcpy(SELFLD(dir, rev_dns_src, rev_dns_dst), hent->h_name,
> > > + min(sizeof(n->rev_dns_src), strlen(hent->h_name) + 1));
> > 
> > Just use sizeof(n->rev_dns_src) as the size argument here instead of the
> > min(), strlcpy will take care of the rest.
> 
> OK, yeah, sorry for such stupid mistakes ...

No problem. I'll apply your patch with the change squashed in so you
don't need to respin the patch.

-- 
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 netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] Re: [PATCH 4/5] flowtop: Show rate in bits by default but in bytes optionaly

2015-10-27 Thread Tobias Klauser
On 2015-10-27 at 01:00:50 +0100, Vadim Kochan  wrote:
> Show rate in bits, but allow to show in bytes by -B,--rate-bytes option.

I think it should be the other way around, i.e. the default mode shows the
rate in bytes and you can switch to bits via command-line option. In my
experience bits/s are mostly used in the context of lower level protocols
(e.g. Ethernet), while higher level protocols (such as the ones handled
by flowtop) use bytes/s.

Care to respin accordingly?

-- 
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 netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] Re: [PATCH 5/5] flowtop: Use bool for show_src option

2015-10-27 Thread vkochan
On Tue, Oct 27, 2015 at 12:08:03PM +0100, Tobias Klauser wrote:
> On 2015-10-27 at 01:00:51 +0100, Vadim Kochan  wrote:
> > Use boolean false/true for show_src option value.
> > 
> > Signed-off-by: Vadim Kochan 
> 
> Sorry, I applied this with the wrong author as I didn't properly amend
> :(

No problem:) I really don not care about it, and actually this is almost
your fix, also I failed it even on 2nd try:)

-- 
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 netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.