Reinjecting IP Packets
Hi Guys,
I'm trying to figure out what is the best way to reinject IP packets
into the stack. Does anyone have good/right/left ideas on this?
Thanks,
Patrick Sodre
Quoted 3 lines · Patrick Sodre Carlos
Hi Guys,
I'm trying to figure out what is the best way to reinject IP packets
into the stack. Does anyone have good/right/left ideas on this?
Maybe netif_rx() in net/core/dev.c ?
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
My mistake... I forgot to mention that the packet will be coming from
user-space.
Patrick
Quoted 10 lines · Ben Greear
Quoted 3 lines · Patrick Sodre Carlos
Hi Guys,
I'm trying to figure out what is the best way to reinject IP packets
into the stack. Does anyone have good/right/left ideas on this?Maybe
netif_rx()innet/core/dev.c?Ben
Quoted 5 lines · Patrick Sodre Carlos
My mistake... I forgot to mention that the packet will be coming from
user-space.Patrick
Then just use raw packets. Find the source of 'ping' and send packets just like it does...
ld->icp.net.icmp_id = ld->ident;
ld->icp.net.icmp_cksum = 0;
ld->icp.net.icmp_cksum = chksum(&ld->icp, len);
if(sendto(ld->s, &ld->icp, len, 0, &ld->where, sizeof(ld->where)) != len)
perror("ping: sendto");
}Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
Quoted 4 lines · Patrick Sodre Carlos
My mistake... I forgot to mention that the packet will be coming from
user-space.Patrick
Maybe net_queue_xmit() then?
If not, you need to explain more where the pkt is coming from, and where you want it re-injected into the stack.
Ben
Quoted 21 lines · Ben Greear
Quoted 12 lines
Quoted 3 lines · Patrick Sodre Carlos
Hi Guys,
I'm trying to figure out what is the best way to reinject IP packets
into the stack. Does anyone have good/right/left ideas on this?Maybe
netif_rx()innet/core/dev.c?Ben
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 9 lines · Ben Greear
Quoted 4 lines · Patrick Sodre Carlos
My mistake... I forgot to mention that the packet will be coming from
user-space.Patrick
Maybe
net_queue_xmit()then?
I meant dev_queue_xmit()
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 6 lines · Ben Greear
Quoted 3 lines · Patrick Sodre Carlos
Hi Guys,
I'm trying to figure out what is the best way to reinject IP packets
into the stack. Does anyone have good/right/left ideas on this?Maybe
netif_rx()innet/core/dev.c?
If you want an example of how this is done, look in /net/ipv4/ipip.c and (I'm pretty sure) /net/ipv4/ip_gre.c. I only know 2.4.*, but the files still exist in 2.6, and they probably do it the same way.
Fairly elegant way to strip some headers and send it though again.
Hope that helps,
Gabe