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

Re: Sending the captured packets at NF



--- suresh kumar <suresh_vin@xxxxxxxxxxxxx> wrote:
> I have implemented, IP tunnelling in kernel by hooking to Netfilters. The
> implementation goes as a module. I am sending the packet out by calling
> dev_queue_xmit by filling the required fields in the skb and returning
> NF_STOLEN. I just want to know, if I capture a packet at pre/post routing
> hook and mangle the IP addresses(which could result in local/forward
> delivery) and return NF_ACCEPT to corresponding  NF hook, would the packet be
> routed. 

Presumably, only if you do it at PRE-routing, no?

>This is required so that, if any module registered to NF after this
> tunneling module, can also get the packet and also I don't need to fill in
> the fields in the skb and call dev_queue_xmit. 

Note that, depending on the requirements, it is also possible to create a
tunnel and then use the rtnetlink libs to add a route to it to the routing
tables and avoid the netfilter thing. Good luck finding docs on rtnetlink
though...

cam

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/