In a nutshell, if I create an ICMP ping request from link level upwards and send it via a PF_PACKET/SOCK_RAW socket bound to the loopback interface (lo), why doesn't the OS network stack respond to my ping.

If I type "ping" from the console, everything works fine.

I'm suspicious of routing tables but not entirely sure.

ping is just a simple example, i need to do TCP/Telnet HTTP/ udp etc all using raw sockets to localhost.