1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
19739: gnrc/rpl: fix incorrect addition overflow check r=maribu a=szsam




Co-authored-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
bors[bot] 2023-06-17 16:25:56 +00:00 committed by GitHub
commit 1bed7dde15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ uint16_t calc_rank(gnrc_rpl_dodag_t *dodag, uint16_t base_rank)
add = CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE;
}
if ((base_rank + add) < base_rank) {
if ((uint16_t)(base_rank + add) < base_rank) {
return GNRC_RPL_INFINITE_RANK;
}