LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2005, 02:30 AM   #1
alwaysrookie
LQ Newbie
 
Registered: Nov 2005
Posts: 5

Rep: Reputation: 0
Question 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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet Filter to redirect a packet to a user level process akawale Linux - Networking 3 09-01-2006 12:06 PM
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
packet fragmentation in packet forwarding code cranium2004 Linux - Networking 0 05-16-2005 04:05 AM
Dropped packet logging jonr Linux - Networking 6 11-18-2004 07:25 AM
Suggestions for packet sniffer w/ packet viewing? TruckStuff Linux - Networking 5 05-31-2002 09:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration