1
votes

A registered netfilter hook can get the packet from the linux kernel. Here linux kernel gets the packet, looks for registered hooks, and passes the packet to them.

The general flow would be: 1. NIC receives the frame 2. Places it in DMA rx ring 3. Kernel's networking subsystem takes it from the DMA rx ring.

But is there a way to get the packet before it enters into linux networking subsystem (may be a big term, my intention is kernel networking code that takes the packet first). That is, my driver should get the packets before it goes into the linux networking stack.

I am a learner and trying to write a piece of code that does the packet processing in the kernel.

Please correct my understanding if wrong and help me with good pointers to read.

1
Can you please clarify on your intention to take the packet from DMA rx ring before sending it to the IP stack ? - Karthik Balaguru

1 Answers

1
votes

Just modify the network NIC card driver? It is the one who got the ISR first. You should be able to filter it there.