Re: Packet Injection within netfilter module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux