Fixed UDPLite receive: checksum was calculated wrong if checksum coverage != tot_len

This commit is contained in:
goldsimon 2007-10-09 19:43:29 +00:00
parent 0f9799d7e0
commit 536f2e42d2
2 changed files with 7 additions and 6 deletions

View File

@ -424,13 +424,14 @@ HISTORY
++ Bug fixes:
2007-10-09 Simon Goldschmidt
* udp.c, inet.c, inet.h: Fixed UDPLite: send: Checksum was always generated too
short and also was generated wrong if checksum coverage != tot_len;
receive: checksum was calculated wrong if checksum coverage != tot_len
2007-10-08 Simon Goldschmidt
* mem.c: lfree was not updated in mem_realloc!
2007-10-07 Simon Goldschmidt
* udp.c, inet.c, inet.h: Fixed UDPLite SENDING: Checksum was always generated
too short and also was generated wrong if checksum coverage != tot_len.
2007-10-07 Frédéric Bernon
* sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential
crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT:

View File

@ -205,9 +205,9 @@ udp_input(struct pbuf *p, struct netif *inp)
goto end;
}
}
if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
if (inet_chksum_pseudo_partial(p, (struct ip_addr *)&(iphdr->src),
(struct ip_addr *)&(iphdr->dest),
IP_PROTO_UDPLITE, chklen) != 0) {
IP_PROTO_UDPLITE, p->tot_len, chklen) != 0) {
LWIP_DEBUGF(UDP_DEBUG | 2,
("udp_input: UDP Lite datagram discarded due to failing checksum\n"));
UDP_STATS_INC(udp.chkerr);