All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias DiPasquale <codeslinger@gmail.com>
To: Juha Heljoranta <juha.heljoranta@evtek.fi>,
	netfilter-devel@lists.netfilter.org
Subject: Re: Modify skb from match module?
Date: Thu, 17 Feb 2005 08:14:21 -0500	[thread overview]
Message-ID: <876ef97a05021705149c5180d@mail.gmail.com> (raw)
In-Reply-To: <4213B519.3080201@evtek.fi>

On Wed, 16 Feb 2005 23:03:21 +0200, Juha Heljoranta
<juha.heljoranta@evtek.fi> wrote:
> I would like to associate some information to struct sk_buff *skb so
> that it would be available later while processing packet. But it turns
> out that the skb is const
> 
>     static int match(const struct sk_buff *skb, ...
> 
> Is there any way to modify skb from match module? 

No. As you correctly point out, the sk_buff is constant and thus
unmodifiable. Packets can only be modified by rules in the mangle
table using a target, not a match.

> Or is there another way to store/cache information so that it can be later
> associated to skb.

Potentially, depending on the protocol you need to manipulate, you
could create a conntrack helper that has its own data structure for
storing the information you require. This would allow you to store
data on a per-connection basis. This data would not persist past the
life of the connection, however.

Alternatively, you could create a module that serves only to store the
data that you need and call out to it in your match module in order to
save data about packets you match on. This would allow you to store
data beyond the life of a connection or single packet and also to
aggregate data in more complicated manners. You would then have to
come up with some way to clean this data, however.

-- 
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d

      reply	other threads:[~2005-02-17 13:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-16 21:03 Modify skb from match module? Juha Heljoranta
2005-02-17 13:14 ` Tobias DiPasquale [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=876ef97a05021705149c5180d@mail.gmail.com \
    --to=codeslinger@gmail.com \
    --cc=juha.heljoranta@evtek.fi \
    --cc=netfilter-devel@lists.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.