create and insert packet at timer event

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

 



Hello,

For my experiments I would like to create ( alloc_skb ) and ip route a
packet on a timer event in a kernel module I'm developing.
1) It doesn't have an incoming device therefore I can't use netif_rx
2) It doesn't have a cached route or a socket ( in fact it may even
have a source ip for a different host )

Is there anyway I can pass it onto the ip_forward or something similar
( i.e. onto the tcp/ip network stack )?  At the moment I'm trying to
get a route using the following code:

rt = ip_route_output( &init_net, iph->daddr,/*iph->saddr*/ 0, 0, 0) ) ;

This crashes the kernel ( computer freezes up instantly ). I know
iph->daddr is correct using printk, So I'm guessing ( after studying
the source ) that init_net is
incorrect. I must be honest I don't really understand this network
namespace and not even sure if this is the right way to go to solve my
problem.

thanks in advance
Iain
--
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