Find the answer to your Linux question:
Results 1 to 4 of 4
hi all if anyone could help me please how can i send an ethernet frame to the kernel?? i use the function netif_rx() which is called by the devise driver ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2005
    Posts
    6

    HOW TO SEND AN ETHERNET FRAME TO THE KERNEL????


    hi all
    if anyone could help me please
    how can i send an ethernet frame to the kernel??
    i use the function netif_rx() which is called by the devise driver but it always causes a KERNEL PANIC(
    my main objective is to send to the tcp/ip stack of the kernel my own ethernet frame or sk_buff and emulate as if it came from the ethernet device
    plz help
    thnx alot

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    How are you currently implementing it (code snippet!)

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Are you writing a NIC device driver, or do you just want to feed your own frames into the kernel? In the latter case, you can use the TUN/TAP driver. It creates a misc char dev, which you can send an ioctl to in order to create a virtual network device, which you can then send and receive frames to and from using a file descriptor. All this is done from user space, which eliminates the risk of a kernel panic, and eases debugging.

    If you're writing a device driver or otherwise need to do it from kernel space, do as lakerdonald says and attach the relevant code snippet. Also recompile the kernel with debugging support and post the panic message (including stack trace).

  4. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •