On 2015-11-03 at 19:06:47 +0100, Vadim Kochan <[email protected]> wrote:
> Added 'prev' field to make double-linked list.

Please describe _why_ this is needed (i.e. this change being needed to
support sorting of the flow list). Also, please change the series such
that this patch comes right before the one actually using the double
linked list for the first time.

> 
> Signed-off-by: Vadim Kochan <[email protected]>
> ---
>  flowtop.c | 68 
> +++++++++++++++++++++++++++++++++++----------------------------
>  1 file changed, 38 insertions(+), 30 deletions(-)
> 
> diff --git a/flowtop.c b/flowtop.c
> index 6fd3c6a..cf9ac6f 100644
> --- a/flowtop.c
> +++ b/flowtop.c
> @@ -65,7 +65,7 @@ struct flow_entry {
>       char city_src[128], city_dst[128];
>       char rev_dns_src[256], rev_dns_dst[256];
>       char procname[256];
> -     struct flow_entry *next;
> +     struct flow_entry *next, *prev;

Could we use a kernel-style struct list_head here and use userspace
ports of the proven and stable helpers in linux/rculist.h to
access/manipulate the list instead of manually implementing it (which
makes it a lot more likely to get something wrong in some corner case)?

-- 
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/d/optout.

Reply via email to