mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
make use of the IPv6 upper-layer checksum calculation
This commit is contained in:
parent
aaccd37a2f
commit
4e5b60e403
@ -1013,8 +1013,10 @@ int32_t destiny_socket_sendto(int s, const void *buf, uint32_t len, int flags,
|
||||
current_udp_packet->length = HTONS(UDP_HDR_LEN + len);
|
||||
temp_ipv6_header->length = UDP_HDR_LEN + len;
|
||||
|
||||
current_udp_packet->checksum = ~udp_csum(temp_ipv6_header,
|
||||
current_udp_packet);
|
||||
current_udp_packet->checksum = ~ipv6_csum(temp_ipv6_header,
|
||||
(uint8_t*) current_udp_packet,
|
||||
UDP_HDR_LEN + len,
|
||||
IPPROTO_UDP);
|
||||
|
||||
ipv6_sendto(&to->sin6_addr, IPPROTO_UDP,
|
||||
(uint8_t *)(current_udp_packet),
|
||||
|
@ -58,7 +58,7 @@ void udp_packet_handler(void)
|
||||
udp_header = ((udp_hdr_t *)(m_recv_ip.content.ptr + IPV6_HDR_LEN));
|
||||
payload = (uint8_t *)(m_recv_ip.content.ptr + IPV6_HDR_LEN + UDP_HDR_LEN);
|
||||
|
||||
chksum = udp_csum(ipv6_header, udp_header);
|
||||
chksum = ipv6_csum(ipv6_header, (uint8_t*) udp_header, NTOHS(udp_header->length), IPPROTO_UDP);
|
||||
|
||||
if (chksum == 0xffff) {
|
||||
udp_socket = get_udp_socket(ipv6_header, udp_header);
|
||||
|
Loading…
Reference in New Issue
Block a user