Skip to contentSkip to conversation

Problem with nf_register_hook

DISCUSSION Kanhu Rauta 1 participant 1 message Feb 16, 2007

lore
Share & tools
lore
#0 lore raw

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 };

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