netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Gardiner <bengardiner@nanometrics.ca>
To: Ali Hamidi <ali.hamidi759@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Packet Injection within netfilter module
Date: Tue, 13 Apr 2010 09:04:42 -0400	[thread overview]
Message-ID: <m2pc35f83941004130604vee38e1ebj74fe926385c87fab@mail.gmail.com> (raw)
In-Reply-To: <m2v6a3fa21004130113tbb35e00cp788616f0ae22a591@mail.gmail.com>

On Tue, Apr 13, 2010 at 4:13 AM, Ali Hamidi <ali.hamidi759@gmail.com> wrote:
> Is there any way to inject a newly created packet based on the
> captured packet inside a netfilter hook call back function?
> My Goal is to capture a packet change compress its tcp payload and
> send it. i read ipcomp.c and i used its source. when i change skb size
> (like len) and tail pointer kernel hangs. maybe the way to do, is to
> create a new packet based on captured packet and ask kernel to send
> it. I just don't know how to ask kernel to send a newly created
> packet?

I'm not sure this will work -- it's just an idea that comes to mind.
Perhaps you could use TUN to inject a newly created packet from a
userspace application?

packet ---> netfilter rule with userspace target ---> userspace
payload compressor ---> /dev/tunX

-- 
Ben Gardiner
Nanometrics Inc.
+1 (613) 592-6776 x239
http://www.nanometrics.ca

  reply	other threads:[~2010-04-13 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  8:13 Packet Injection within netfilter module Ali Hamidi
2010-04-13 13:04 ` Ben Gardiner [this message]
     [not found] ` <n2r8363055a1004130947r17b18e9dgf33b38f8648b3f82@mail.gmail.com>
2010-04-14 14:57   ` Ali Hamidi
  -- strict thread matches above, loose matches on Subject: below --
2010-04-13 19:36 Morgon J. Kanter

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=m2pc35f83941004130604vee38e1ebj74fe926385c87fab@mail.gmail.com \
    --to=bengardiner@nanometrics.ca \
    --cc=ali.hamidi759@gmail.com \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).