Re: How to duplicate packets in PRE_ROUTING hook and send it to multiple machines in simpe way

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

 



I was wondering if i copy buffer from PRE_ROUTING and call okfn with
new buffer , okfn being the function pointer passed to my hooking
function @ PRE_ROUTING,will this work always.?? I tried this with test
module and it was working.but i am not sure if it is going to work
always and what can be the issues with this approach.

So  code snippet looks like this.

struct sk_buff * packet2 = skb_copy(*pskb);
if(packet2){
    modify_packet(packet2);   //modify ip addr ,port etc.
     okfn(packet2);
}

This does send packet out . Is this correct way to achieve this ?? Are
there any security or accounting related things that i am missing
here.

--Rohit

On Dec 13, 2007 5:23 PM, Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx> wrote:
>
> On Dec 13 2007 12:16, Rohit wrote:
> >
> >I want to send tcp packets received on IP1: P1 to different machines
> >say IP2:P2, IP3:P3. I have a kernel module which  uses PRE_ROUTING and
> >POST_ROUTING.But i am not very clear about how can i make copies of
> >each tcp packet that i recieve in PRE_ROUTING and send it to these
> >machines __efficiently__ ??
>
> Take http://marc.info/?l=netfilter-devel&m=119601957530762&w=2
> It's not perfect yet, but is reported to do its job.
>
-
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