netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ali Hamidi <ali.hamidi759@gmail.com>
To: Justin Yaple <yaplej@gmail.com>
Cc: netfilter-devel <netfilter-devel@vger.kernel.org>
Subject: Re: Packet Injection within netfilter module
Date: Wed, 14 Apr 2010 19:27:23 +0430	[thread overview]
Message-ID: <h2v6a3fa21004140757y68bb686g5f0a122b80df922@mail.gmail.com> (raw)
In-Reply-To: <n2r8363055a1004130947r17b18e9dgf33b38f8648b3f82@mail.gmail.com>

Dear Justin,
I just want to thank you for you good reply. Your code saved my life
in a school project. It is well-written and I learned many things from
it, because I am a newbie in netfilter kernel modules programming. Any
way Thanks again for your reply. You gave me new hope to continue.

On 4/13/10, Justin Yaple <yaplej@gmail.com> wrote:
> Ali,
>
> Are you sending this copied packet somewhere else?  If your goal is
> just to modify the skb why make a copy before you modify it?  I have
> written a kernel module that can compress/decompresses TCP payloads
> for traffic between any number of hosts if the traffic is routed
> through two systems running my module.  If you want to download the
> source you can get it from
> http://packetsqueezer.portal.codespaces.com.
>
> To send a new skb though you can do this.  It assumes all the required
> fields are already populated correctly.
> NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, skb->dst->dev,
> dst_output); // Sent the packet.
>
>
> On Tue, Apr 13, 2010 at 1: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?
>> --
>> To unsubscribe from this list: send the line "unsubscribe netfilter-devel"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

  parent reply	other threads:[~2010-04-14 14:57 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
     [not found] ` <n2r8363055a1004130947r17b18e9dgf33b38f8648b3f82@mail.gmail.com>
2010-04-14 14:57   ` Ali Hamidi [this message]
  -- 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=h2v6a3fa21004140757y68bb686g5f0a122b80df922@mail.gmail.com \
    --to=ali.hamidi759@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=yaplej@gmail.com \
    /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).