Forum Discussion
There are several things I see in your code:[list][*]all the fields in the header must be big endian, but the Nios II CPU is little endian. There is no change for byte fields, but for 16-bit words fields (such as ident and len) you must use the htons() function[*]the iph_chksum is only the checksum of the IP header, and shouldn't include the UDP header[*]You calculate the checksum on the "buffer" table before you copy the data to it[/list]further more, most of the current PC hardware has some network offloading, which means that malformed packets (especially IP packets with bad checksums) will be dropped by the network card before it has a chance to reach Wireshark. This means that if you send packets with bad checksums, you will probably never see them and think that nothing has been sent. Check in the driver options if you can disable IP/UDP/TCP hardware checksum verification. I know you can do this on some Intel cards. If not, check if you have an old low-cost network card that you could use in your PC instead, maybe it will work better at accepting anything ;)