mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +08:00
Added UDP lite support for sockets
This commit is contained in:
@@ -414,7 +414,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
||||
u16_t chklen;
|
||||
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %"U16_F"\n", q->tot_len));
|
||||
/* set UDP message length in UDP header */
|
||||
chklen = pcb->chksum_len;
|
||||
chklen = pcb->chksum_len_tx;
|
||||
if (chklen < sizeof(struct udp_hdr)) {
|
||||
if (chklen != 0) {
|
||||
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE pcb->chksum_len is illegal: %"U16_F"\n", chklen));
|
||||
@@ -431,7 +431,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
||||
/* calculate checksum */
|
||||
#if CHECKSUM_GEN_UDP
|
||||
udphdr->chksum = inet_chksum_pseudo(q, src_ip, &(pcb->remote_ip),
|
||||
IP_PROTO_UDP, pcb->chksum_len);
|
||||
IP_PROTO_UDP, chklen);
|
||||
/* chksum zero must become 0xffff, as zero means 'no checksum' */
|
||||
if (udphdr->chksum == 0x0000)
|
||||
udphdr->chksum = 0xffff;
|
||||
|
||||
Reference in New Issue
Block a user