Skip to contentSkip to conversation

dev_add_pack() question

DISCUSSION Rafal Wojtczuk 1 participant 1 message May 9, 2001

lore
Share & tools
lore
#0 lore raw

Hello,
I register a callback function with dev_add_pack() this way:
memset (&proto, 0, sizeof proto);
proto.type = htons (ETH_P_ALL);
proto.func = my_callback_function;
dev_add_pack (&proto);
my_callback_function() receives all packets with local src/dst IP (including SNATed ones) as well as all incoming ones, but forwarded outgoing packets are not passed to my_callback_function(). Looks like AF_PACKET sockets also rely on dev_add_pack(), yet of course tcpdump (correctly) shows all the packets. How should I register a callback with dev_add_pack() so that the callback receives all the packets ?

Save yourself,
Nergal