Packet socket not receive data
Hi everyone,
First of all I want apologise for my poor english. I have a problem with packet socket and can't find solution for 2 weeks. I create application responsible for network sniffing, one socket for send data ( socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) and second for receive (socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)). When I start monitoring network I can't see any data, but when I first send data through sendto function, packet socket start working, receiving packets and everything works fine. For receive I use recvfrom function. I have no idea where is problem. I suppose it is problem with kernel (my version is 3.1.5). Do you have any idea what can be a problem ?
|