SOCK_PACKET: ETH_P_ALL vs. ETH_P_IP

Herbert Rosmanith (herp@wildsau.idv.uni-linz.ac.at)
Sun, 14 Apr 1996 04:46:19 +0200 (MET DST)


hi

suppose I open a socket with:

s=socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL));

then I'll get all packets sent and received from/to the machine a program
using this call is running. however, when one does:

s=socket(AF_INET, SOCK_PACKET, htons(ETH_P_IP));

only those packets *sent* to the machine are put into the program.
a packet, that is generated on the local machine and is sent out onto
the the network will not be put into this socket.

is this the correct behaviour ? I thought that ETH_P_IP means "all
IP packets ?" regardless of source/destination.

NB: it's not neccessary to put the IF into promisc. mode.

/herp
herp@wildsau.idv.uni-linz.ac.at