Search code examples
linuxnetwork-programmingkernelethernet

Re-edit netif_Rx function and up the respective module


I edit the function netif_rx in the dev.c at the /net/core just to make a printk when a packet arrives.

I called "make" at the kernel's root directory but i don't know witch module was compiled. I need to update the old-module ir order to turn on the changes that i made.

If i want to see my changes i need to:

1-make at the kernel's root directory;
2- make modules;
3-make bzImage;
4- insert the new bzImage on the grub file;
5-Reboot;

I want to to access directly to the modulean update withou do all that things.

Could you help me.

Best regards, Ricardo Ribeiro


Solution

  • If I get your goal correctly, the simplest you can do is to implement your own kernel module where you register a protocol handler for ETH_P_ALL with dev_add_pack(). This way you will receive all incoming packets for a particular device (if you also specify pt->dev) or all devices (if pt->dev is NULL).