I am studying raw sockets. I used the IP_HDRINCL option to build my own IP headers. After the IP header, I am building a UDP header. Then I am sending the packet to my syste
There seems to be a problem with the calculation of the UDP check-sum.
udp->check=in_cksum((unsigned short*) udp,8+strlen(data));
UDP check-sum must include something called the "Pseudo-Header" before the UDP header. The code calculates checksum over only the UDP header and the payload. The UDP receiving process might not be receiving the packets because of the wrong check-sums.
Enable check-sum validation in Wireshark and check whether the check-sum fields of the UDP packets are correct or not.
See the following: