That's correct when you have the ethernet header. I don't have it, so I inject it into the stack to fill
up all the routing information needed , mainly detination mac address.

Chava
----- Original Message ----- From: "Gilboa Davara" <[EMAIL PROTECTED]>
To: "IL Linux" <linux-il@linux.org.il>
Sent: Thursday, October 05, 2006 5:45 PM
Subject: Re: netif_rx and dev stack


On Thu, 2006-10-05 at 16:02 +0200, Chava Leviatan wrote:
Hello,


I have a 2.4.18 machine with 2 ethernet interfaces.

I am trying to simulate a scenario where packet has just arrived from
one interface and going to the other.

I have build a kernel module that runs a kernel thread. That kernel
thread is invoked every second, and then
it does the following ;

    -                alloc_skb
    -                Fill the proper sk_buff fields
    -                Fill IP header fields
    -                Fill ICMP header fields
    -                skb_put with the data length
    -                call to netif_rx

I am able to see the packets with ethreal (on the correct interface).
I have also put some debug prints into the
kernel code (dev.c) and I am able to see those packets getting into
__kfree_skb.

However, when i do the rmmod the machine crashes , i.e., performs a
reset !!
When I remove the netif_rx the rmmod returns ok.

Can anyone please explain why does it crash ??


Any help is apreciated,
Thanks,
Chava


If my memory serves me right, you should use dev_queue_xmit to send the
SKB, instead of calling netif_rx directly.

- Gilboa.
P.S. Posting in HTML is considered bad netiquette in MLs.




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to