Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


Closed Thread
  Search this Thread
Old 04-09-2005, 02:20 AM   #1
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
Packet Transmission in the Kernel

Dear All,

I'm doing linux kernel programming for my senior year project at college. I've studied the tcp/ip implementation in kernel 2.4 to some extent, since i'm working on 2.4. So i was trying to transmit a test IP packet from scratch. This is being done as an extension to the kernel, in a file of my own. My implementation follows the way a packet is being transmitted in the kernel, specifically in the ip_output.c file. The problem i'm having is that when i try to find out the route for my destination using the ip_route_output() function i always get a null and hence the packet transmission doesn't occur. Here's where the problem occurs:

/* Get dst_entry if not present */
ip_route_output(&rt, dest, src, 0, dev-ifindex);

if(rt == NULL)
// some error and exit code

It turns out that rt is null. src and dest are the source and destination ip addresses in network byte order in hex. rt is defined as struct rtable* and dev is the transmitting device..that is eth0 in this case.

Does anyone have any clue about why rt is turning out to be null?
Old 04-09-2005, 07:39 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 68
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

Please continue here:

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Packet Transmission in the Kernel sidra Programming 3 04-17-2005 10:48 AM
packet sending function in kernel sunnyriver Linux - Networking 0 03-22-2004 08:46 PM
packet handling at the kernel level valib4u *BSD 4 09-14-2003 03:16 AM
kernel packet forwarding doodah Linux - Networking 4 08-17-2001 08:14 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:07 PM.

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