netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* REOUTE target extenstion
@ 2015-05-27 10:11 Eddi Linder
  2015-05-27 11:37 ` Jan Engelhardt
  2015-05-27 11:37 ` Florian Westphal
  0 siblings, 2 replies; 9+ messages in thread
From: Eddi Linder @ 2015-05-27 10:11 UTC (permalink / raw)
  To: netfilter-devel

Hey,

I am planning to write a "redirection" extension that based on a match
will copy the matched packet to other interfaces.
The extension should work both on input chains and output chains
(ingress and egress traffic), and will be able to copy the packet as
egress or ingress of the selected interface.
I currently have a basic working POC, but I have some concerns.

1. When dealing with egress traffic (OUTPUT/POSTROUTING), the packet
is lacking the Ethernet layer headers. So, as I see it, I can either
fetch those fields by myself which is inefficient, or somehow change
only the output device we are dealing with and call the function
following the NF_HOOK. The latter option requires me to pass the okfn
pointer somehow into the target handling code.
2. An skb received on a bridge needs to be stripped from its nf_bridge
fields, can it cause any problems after the redirect?
3. I'd like to support multiple redirects per-match, currently I use
skb_clone before each redirect (otherwise, the original skb is being
freed), is that the best way to do it?

The current api I'm looking into is: "iptables -A INPUT -i eth2 -j
REROUTE --actions input:eth0,output:veth0,continue".
Upon packet received on eth2 it will redirect the packet into eth0 rx
queue, veth1 tx queue, and will continue the packet handling on eth2
(return XT_CONTINUE).

Any suggestions or comments will be appreciated.
Thanks,
Eddie

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

end of thread, other threads:[~2015-05-31 11:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 10:11 REOUTE target extenstion Eddi Linder
2015-05-27 11:37 ` Jan Engelhardt
2015-05-27 11:37 ` Florian Westphal
2015-05-27 11:56   ` Eddi Linder
2015-05-27 12:11     ` Florian Westphal
2015-05-27 12:40       ` Pablo Neira Ayuso
2015-05-29 12:02         ` Eddi Linder
2015-05-29 12:50           ` Jan Engelhardt
2015-05-31 11:49             ` Eddi Linder

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