kee
kee

Reputation: 46

understanding linux driver that receives a packet first than linux stack

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.

Upvotes: 1

Views: 243

Answers (1)

tony-p-lee
tony-p-lee

Reputation: 807

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

Upvotes: 1

Related Questions