Skip to content
Snippets Groups Projects
Unverified Commit d2ccbc85 authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #7957 from PeterKietzmann/pr_ipv6_hdr_fix

net/ipv6/hdr: fix issue #5944
parents d689a0c8 d7e58d48
No related branches found
No related tags found
No related merge requests found
...@@ -288,7 +288,7 @@ static inline uint32_t ipv6_hdr_get_fl(const ipv6_hdr_t *hdr) ...@@ -288,7 +288,7 @@ static inline uint32_t ipv6_hdr_get_fl(const ipv6_hdr_t *hdr)
static inline uint16_t ipv6_hdr_inet_csum(uint16_t sum, ipv6_hdr_t *hdr, static inline uint16_t ipv6_hdr_inet_csum(uint16_t sum, ipv6_hdr_t *hdr,
uint8_t prot_num, uint16_t len) uint8_t prot_num, uint16_t len)
{ {
if ((sum + len + prot_num) > 0xffff) { if (((uint32_t)sum + len + prot_num) > 0xffff) {
/* increment by one for overflow to keep it as 1's complement sum */ /* increment by one for overflow to keep it as 1's complement sum */
sum++; sum++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment