Packet dropped....while Netfiltering...
Hello,
I was trying to filter packets.. and installed NF_IP_PRE_ROUTING & NF_IP_POST_ROUTING.
// input hook
input_filter.list.next = NULL;
input_filter.list.prev = NULL;
input_filter.hook = input_handler;
input_filter.pf = PF_INET; // IPv4
input_filter.hooknum = NF_IP_PRE_ROUTING;
// output hook
output_filter.list.next = NULL;
output_filter.list.prev = NULL;
output_filter.hook = output_handler;
output_filter.pf = PF_INET; // IPv4
output_filter.hooknum = NF_IP_POST_ROUTING;
result = nf_register_hook(&output_filter);
result = nf_register_hook(&input_filter);
then, other machine sends a packet to this machine, packet is not received at application.
However, I can see the packet is filtered at NF_IP_PRE_ROUTING. I do not touch anything in the packet and just return NF_ACCEPT, like below.
unsigned int input_handler(
unsigned int hooknum,
struct sk_buff **skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn) (struct sk_buff *) )
{
return NF_ACCEPT
}
I guess packet is dropped between NF_IP_PRE_ROUTING and application.
Does anybody have any clues...
Thanks in advance.
with regards
AlwaysRookie...
|