Re: Problem with nf_register_hook

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

 



hi,

El Fri, 16 Feb 2007 17:56:33 +0530
Kanhu Rauta <krauta@xxxxxxxxx> ha escrit:

> Hi list,
>  
> I am using Linux 2.6.9-42.7.EL kernel, And registering a function in
> netfilter like
>  
> nf_register_hook( &test );    and test is defined like....
>  
> static struct nf_hook_ops test
> = { { NULL, NULL }, print_packet, PF_INET, NF_IP_LOCAL_IN,
> NF_IP_PRI_FILTER };

i don't know if what you do in 2.6 is correct but i'm using this
nf_hook_declaration succefully in 2.6 kernels:

   static struct nf_hook_ops netfilter_ops;
   netfilter_ops.hook     = function;
   netfilter_ops.owner    = THIS_MODULE;
   netfilter_ops.pf       = PF_INET;
   netfilter_ops.hooknum  = NF_IP_PRE_ROUTING;
   netfilter_ops.priority = NF_IP_PRI_FIRST;
   nf_register_hook(&netfilter_ops);

hope this helps,

topi

>  
> print_packet is defined like....
> static unsigned int print_packet (unsigned int hook, struct sk_buff
> **pskb, const struct net_device *indev, const struct net_device
> *outdev,
>                 int (*okfn)(struct sk_buff *) ) {
>  
> }
>  
> PROBLEM: the registration of the function is successful.....
> but I am not getting the local packets(destination ip is my ip) in
> this hook function (print_packet).
>  
> But I am able to see the packets meant for me in tcpdump and also in
> my application running in userspace.
>  
> This module works successfully in 2.4 kernel....
>  
>  
> Can any one please help me to resolve the problem ?
> 
>  With Regards,
>       kanhu

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux