can't read arp packets in c

i have the following simple code to capture all the arp packet sent to my device but it doesn’t print anything #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <arpa/inet.h> #include <net/ethernet.h> int main(){ int sock; char recvbuf[2048]; if((sock=socket(PF_PACKET,SOCK_DGRAM,htons(ETH_P_ARP)))==-1){ perror("socket error"); return -1; } for(;;){ if(recvfrom(sock,recvbuf,sizeof(recvbuf),0,NULL,NULL)==-1){ perror("recvfrom error"); } struct… Read More can't read arp packets in c