netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Packet Injection within netfilter module
@ 2010-04-13 19:36 Morgon J. Kanter
  0 siblings, 0 replies; 4+ messages in thread
From: Morgon J. Kanter @ 2010-04-13 19:36 UTC (permalink / raw)
  To: netfilter-devel

> 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've been looking to do something similar, and running into my own questions.

First, does your newly created packet completely replace the old, uncompressed 
packet? Because then you should be able to just issue an ACCEPT verdict to the 
packet, but pass along new payload data for said packet as part of issuing the 
verdict.

As I said, I've been looking to do something similar (and in fact just joined 
this list with the hope of getting some answers) -- would you then have to go 
and change, say, the TCP windows? At the very least it seems you'll need to 
mangle the returning ACK numbers to the uncompressed value, so the original 
packet's sender gets the correct acknowledgment. Is there a way to handle this 
automatically in the Linux kernel? It seems like this would be a valuable 
thing to implement as part of queue/conntrack if it's not implemented already 
-- is it?

I ask because I will need to implement exactly this functionality if it's not 
already around. I'm also trying to figure out the best place to put it.

Thanks,
-- Morgon

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Packet Injection within netfilter module
@ 2010-04-13  8:13 Ali Hamidi
  2010-04-13 13:04 ` Ben Gardiner
       [not found] ` <n2r8363055a1004130947r17b18e9dgf33b38f8648b3f82@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Ali Hamidi @ 2010-04-13  8:13 UTC (permalink / raw)
  To: netfilter-devel

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-14 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13 19:36 Packet Injection within netfilter module Morgon J. Kanter
  -- strict thread matches above, loose matches on Subject: below --
2010-04-13  8:13 Ali Hamidi
2010-04-13 13:04 ` Ben Gardiner
     [not found] ` <n2r8363055a1004130947r17b18e9dgf33b38f8648b3f82@mail.gmail.com>
2010-04-14 14:57   ` Ali Hamidi

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).