LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Packet Transmission in the Kernel (https://www.linuxquestions.org/questions/linux-networking-3/packet-transmission-in-the-kernel-311324/)

sidra 04-09-2005 02:20 AM

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?

david_ross 04-09-2005 07:39 AM

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.

http://www.linuxquestions.org/rules.php

Please continue here:
http://www.linuxquestions.org/questi...hreadid=311322


All times are GMT -5. The time now is 04:59 AM.