1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

gnrc_sixlowpan_frag_vrb: append intervals of given base if entry exists

Otherwise the list in `base->ints` will get lost.
This commit is contained in:
Martine S. Lenders 2019-12-03 12:23:56 +01:00
parent 0251d6585e
commit d9ecc0b9bb
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -80,6 +80,34 @@ gnrc_sixlowpan_frag_vrb_t *gnrc_sixlowpan_frag_vrb_add(
vrbe->super.dst_len,
addr_str), vrbe->out_tag);
}
/* _equal_index() => append intervals of `base`, so they don't get
* lost. We use append, so we don't need to change base! */
else if (base->ints != NULL) {
gnrc_sixlowpan_frag_rb_int_t *tmp = vrbe->super.ints;
if (tmp != base->ints) {
/* base->ints is not already vrbe->super.ints */
if (tmp != NULL) {
/* iterate before appending and check if `base->ints` is
* not already part of list */
while (tmp->next != NULL) {
if (tmp == base->ints) {
tmp = NULL;
}
/* cppcheck-suppress nullPointer
* (reason: possible bug in cppcheck, tmp can't
* clearly be a NULL pointer here) */
tmp = tmp->next;
}
if (tmp != NULL) {
tmp->next = base->ints;
}
}
else {
vrbe->super.ints = base->ints;
}
}
}
break;
}
}