Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page Kernel networking - dev_queue_xmit() is creating a hang after switching 255 packets
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 01-16-2008   #1 (permalink)
TechM
Just Joined!
 
Join Date: Jan 2008
Posts: 1
Kernel networking - dev_queue_xmit() is creating a hang after switching 255 packets

Hi,

Basically, I am trying to write a simple layer2 switching software.
I am trying to tap a packet in layer 2 using netfilter hook in kernel netif_receive_skb() routine. In the hook handler, I just change the device of the skb and send it out using dev_queue_xmit. Everything works fine till 255 packets, after which the kernel hangs.
Packets are received in eth1 interface and switched to eth0 interface.
Can anyone tell why it hangs after 255 packets? Whatelse should I fill in skb before sending it out, if that could be the problem? Pl. help

The hook handler code is below:

unsigned int PktIn (unsigned int hooknum, struct sk_buff **skb,
const struct net_device *indev, const struct net_device *outdev,
int (*okfn) (struct sk_buff *))
{
struct net_device *out_dev;

out_dev = dev_get_by_name ("eth0");

(*skb)->dev = out_dev;
if ((*skb)->dev->hard_header)
(*skb)->dev->hard_header ((*skb), (*skb)->dev,
ntohs ((*skb)->protocol), NULL, NULL,
(*skb)->len);
dev_queue_xmit (*skb);
return NF_DROP;
}

Thanks,
TechM
TechM is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't mount coolmax HD-360 enclosure ivotron Peripherals / Hardware 1 10-30-2007 04:45 PM
Suse 10.2 Hogging Memory amyno SuSE Linux Help 13 06-28-2007 12:35 AM
About the 2.6 Kernel jasonlambert Linux Tutorials, HOWTO's & Reference Material 0 08-10-2003 05:54 PM
Linux and montherboard drspin Installation 13 07-09-2003 11:27 PM
3c90x in Caldera 2.4 bionik Installation 20 03-12-2003 09:38 PM




All times are GMT. The time now is 06:17 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0