我发送udp包时,软件没有加校验和,但是截包工具抓到有checksum值。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我发送udp包时,软件没有加校验和,但是截包工具抓到有checksum值。
tm4c1294本身可以计算icmp数据包的校验和,在enet_uip示例中,uip.c
#if UIP_OFFLOAD_ICMP_CHKSUM
/* If the hardware is inserting ICMP checksums for us, clear the field to
ensure that the correct checksum is calculated. */
ICMPBUF->icmpchksum = 0;
若在preprocessor 有添加 UIP_OFFLOAD_ICMP_CHKSUM 则硬件上就会处理checksum
您可以尝试在工程内搜索关键字 checksum
在lwiplib.c内
//***************************************************************************** // // Ensure that ICMP checksum offloading is enabled; otherwise the TM4C129 // driver will not operate correctly. // //***************************************************************************** #ifndef LWIP_OFFLOAD_ICMP_CHKSUM #define LWIP_OFFLOAD_ICMP_CHKSUM 1 #endif