All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@eurodev.net>
To: Matthew Strait <quadong@users.sourceforge.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: l7-filter patch for p-o-m
Date: Wed, 01 Jun 2005 12:11:55 +0200	[thread overview]
Message-ID: <429D89EB.5000605@eurodev.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0505312259080.6304@localhost.localdomain>

Matthew Strait wrote:
> Done, done, and done.

it seems that you've been working :)

this is just a quick look at it, i'd need more time to review this thing 
in deep...

>> - Consider using a slab cache instead of kmalloc for your dat_len 
>> allocations
> 
> 
> Considered strongly, but I couldn't get it to work.  Hopefully that's 
> not fatal...

consider it interesting to catch up memory leaks.

> +/* Initialize the match. */
> +static void init(struct ipt_entry_match *m, unsigned int *nfcache)
> +{
> +    *nfcache |= NFC_UNKNOWN;
> +}

kill that nfcache thing, it's obsolete.

> patch-o-matic-ng-20050531-orig/l7-filter/linux-2.6/net/ipv4/netfilter/regexp/regexp.c    
> 1969-12-31 18:00:00.000000000 -0600
> +++ 
> patch-o-matic-ng-20050531/l7-filter/linux-2.6/net/ipv4/netfilter/regexp/regexp.c    
> 2005-05-31 19:48:59.000000000 -0500
> @@ -0,0 +1,1195 @@
> +/*
> + * regcomp and regexec -- regsub and regerror are elsewhere
> + * @(#)regexp.c    1.3 of 18 April 87

a string matching infrastructure in kernel is on the way. I strongly 
recomment you to port your works on top on it. If you're interested I'll 
let you know once Thomas and I get something ready to use.

BTW, you could combine your regexp stuff together with more efficient 
string matching algorithms like Boyer-Moore and Knuth-Pratt-Morris. That 
would be an interesting tradeoff. Of course, the upcoming kernel 
infrastructure will support that, so you won't need to worry about.

> diff -Nurp patch-o-matic-ng-20050531-orig/l7-filter/linux-2.6.patch 
> patch-o-matic-ng-20050531/l7-filter/linux-2.6.patch
> --- patch-o-matic-ng-20050531-orig/l7-filter/linux-2.6.patch    
> 1969-12-31 18:00:00.000000000 -0600
> +++ patch-o-matic-ng-20050531/l7-filter/linux-2.6.patch    2005-05-31 
> 19:48:59.000000000 -0500
> @@ -0,0 +1,49 @@
> +--- linux-2.6.11.3-stock/include/linux/netfilter_ipv4/ip_conntrack.h    
> 2005-03-13 00:44:41.000000000 -0600
> ++++ 
> linux-2.6.11.3-layer7/include/linux/netfilter_ipv4/ip_conntrack.h    
> 2005-03-13 20:30:01.000000000 -0600
> +@@ -177,6 +177,15 @@ struct ip_conntrack
> +     /* Traversed often, so hopefully in different cacheline to top */
> +     /* These are my tuples; original and reply */
> +     struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
> ++
> ++#if defined(CONFIG_IP_NF_MATCH_LAYER7) || 
> defined(CONFIG_IP_NF_MATCH_LAYER7_MODULE)
> ++        struct {
> ++                char * app_proto; /* e.g. "http". NULL before 
> decision. "unknown" after decision if no match */
> ++                char * app_data;  /* application layer data so far.  
> NULL after match decision */
> ++                unsigned int app_data_len;
> ++        } layer7;
> ++#endif

ick, I don't like this. Well, leave it there until we come up with a 
better idea. My proposition: You could use a private hash table similar 
to the conntrack table that stores this information instead. Other 
choice could be Rusty's conntrack extension infrastructure but it's not 
in kernel mainline, it still needs some benchmarking.

--
Pablo

  reply	other threads:[~2005-06-01 10:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01  4:35 l7-filter patch for p-o-m Matthew Strait
2005-06-01 10:11 ` Pablo Neira [this message]
2005-06-22 18:16   ` Matthew Strait
2005-07-12  8:42     ` Amin Azez
2005-06-11 15:19 ` Patrick McHardy
2005-06-22 17:57   ` Matthew Strait

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=429D89EB.5000605@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=quadong@users.sourceforge.net \
    /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.