All of lore.kernel.org
 help / color / mirror / Atom feed
* Splitting network packets from target modules
@ 2012-11-15 13:14 arif
  2012-11-15 13:49 ` Torsten Luettgert
  0 siblings, 1 reply; 2+ messages in thread
From: arif @ 2012-11-15 13:14 UTC (permalink / raw)
  To: netfilter-devel

Hi,

I'm trying to write a target module which will do the following :

1) oldskb will be cached.
2) newskb1,newskb2....newskbn will be allocated and initialized.
3) packet will be dropped using NF_DROP
4) Newskbs will be sent to L4(target will work from PREROUTING hook)

But i'm confused how i'm going to send these new skbs to uplink.
returning NF_ACCEPT will not do the trick i guess.

Is there any existing target module which tries to do send multiple skbs
to uplink?

cheers
arif


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

* Re: Splitting network packets from target modules
  2012-11-15 13:14 Splitting network packets from target modules arif
@ 2012-11-15 13:49 ` Torsten Luettgert
  0 siblings, 0 replies; 2+ messages in thread
From: Torsten Luettgert @ 2012-11-15 13:49 UTC (permalink / raw)
  To: netfilter-devel; +Cc: arif

On Thu, 15 Nov 2012 19:14:44 +0600
arif <aftnix@gmail.com> wrote:

> But i'm confused how i'm going to send these new skbs to uplink.
> returning NF_ACCEPT will not do the trick i guess.
> 
> Is there any existing target module which tries to do send multiple
> skbs to uplink?

I'd guess TEE would be the right place to look at since it creates
another packet and sends it on. But beware, it's buggy in current
kernels, a fix by Eric Dumazet is required:

diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index ee2e5bc..bd93e51 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -70,6 +70,7 @@ tee_tg_route4(struct sk_buff *skb, const struct
xt_tee_tginfo *info) fl4.daddr = info->gw.ip;
 	fl4.flowi4_tos = RT_TOS(iph->tos);
 	fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
+	fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH;
 	rt = ip_route_output_key(net, &fl4);
 	if (IS_ERR(rt))
 		return false;

Hope that helps,
Torsten

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

end of thread, other threads:[~2012-11-15 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 13:14 Splitting network packets from target modules arif
2012-11-15 13:49 ` Torsten Luettgert

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.