All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: [RFC, NETFILTER]: amanda helper: convert to textsearch infrastructure
Date: Wed, 24 May 2006 12:00:48 +0200	[thread overview]
Message-ID: <44742ED0.6010504@trash.net> (raw)
In-Reply-To: <4473A8A8.3040801@netfilter.org>

Pablo Neira Ayuso wrote:
> Patrick McHardy wrote:
> 
>> I've just converted the amanda helper to the textsearch infrastructure
>> to fix a packet corruption bug. This allows to avoid the data copying
>> and save roughly 64k of memory. The IRC helper looks like a good
>> candidate for this too, FTP is probably quite a bit more complicated.
> 
> 
> It looks fine, just two minor comments. BTW, thanks for doing this: This
> port is on my TODO list since the workshop.
> 
>>  static int __init ip_conntrack_amanda_init(void)
>>  {
>> -    int ret;
>> -
>> -    amanda_buffer = kmalloc(65536, GFP_KERNEL);
>> -    if (!amanda_buffer)
>> -        return -ENOMEM;
>> -
>> -    ret = ip_conntrack_helper_register(&amanda_helper);
>> -    if (ret < 0) {
>> -        kfree(amanda_buffer);
>> -        return ret;
>> +    int ret, i;
>> +
>> +    ret = -ENOMEM;
>> +    for (i = 0; i < ARRAY_SIZE(search); i++) {
>> +        search[i].ts = textsearch_prepare("kmp", search[i].string,
>> +                          search[i].len,
>> +                          GFP_KERNEL, TS_AUTOLOAD);
> 
> 
> I think that the algorithm should be configurable. Although Boyer-Moore
> would not find a matching if the traffic is defragmented (see the header
> of /lib/ts_bm.c), it definitely scales better, so some sysadmins could
> increase performance to the detriment of defragmented traffic:
> 
> http://people.netfilter.org/~pablo/textsearch/


Yes, that really looks better. I guess we could add a module-parameter,
but right now it wouldn't help much because the individual algorithms
can't be configured by the user, they can only be chosen with
"select TEXTSEARCH_...".

> I have an old patch for the FTP helper here somewhere, I could give it
> some spins and send it to you.


Please, I would like to see how complicated it gets. I think what
would really help is something like the fsm algorithm if it would
store the offsets of the individual matches. That would allow to
specify all the possible matches as a single pattern.

      parent reply	other threads:[~2006-05-24 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-19 16:38 [RFC, NETFILTER]: amanda helper: convert to textsearch infrastructure Patrick McHardy
2006-05-24  0:28 ` Pablo Neira Ayuso
2006-05-24  1:32   ` Pablo Neira Ayuso
2006-05-24 10:00   ` Patrick McHardy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44742ED0.6010504@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.