lkml.org 
[lkml]   [2014]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/7] netfilter: Convert print_tuple functions to return void
From
Date
On Tue, 2014-09-30 at 12:22 +0200, Petr Mladek wrote:
> On Mon 29-09-14 16:08:22, Joe Perches wrote:
> > Since adding a new function to seq_file (seq_is_full)
> > there isn't any value for functions called from seq_show to
> > return anything. Remove the int returns of the various
> > print_tuple/<foo>_print_tuple functions.

[a bunch of quoted stuff]

Please remember to cut out from your replies the unnecessary old stuff.
It can take quite awhile to scan through looking for your comments.

> > diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
[]
> > @@ -202,9 +203,8 @@ static int ct_seq_show(struct seq_file *s, void *v)
> > if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct))
> > goto release;
> >
> > - if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
> > - l3proto, l4proto))
> > - goto release;
> > + print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
> > + l3proto, l4proto);
>
> To be precise, we should add:
>
> if (seq_overflow(s))
> goto release;

Precision isn't all that useful when checking seq_<output>.

There really isn't much value in checking each possible
overflow site. A periodic check prior to or in the middle
of a more costly/longish operation should be acceptable.

The entire block that precedes any seq buffer full test will
be redone when the buffer is expanded.



\
 
 \ /
  Last update: 2014-09-30 15:41    [W:0.079 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site