I\'m making a program which create a RAW socket in order to read all traffic. Between the call of socket() and recvfrom() (last one is in a loop to get out all packets from
The level argument to setsockopt should be SOL_SOCKET, not 0:
level
setsockopt
SOL_SOCKET
0
int a = 65535; if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &a, sizeof(int)) == -1) { fprintf(stderr, "Error setting socket opts: %s\n", strerror(errno)); }