The following commit has been merged in the next branch: commit 36a6022e261e5804f9810572e0d370dafb7a6385 Author: Linus Lüssing linus.luessing@web.de Date: Tue Oct 12 09:52:00 2010 +0000
batman-adv: Fix resizing of broadcast seqno buffers on if deletion
Not only the entries of the deleted interface got erased, but also all ones with a lower if_num. This commit fixes this issue by setting the destination appropriately.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
diff --git a/originator.c b/originator.c index 471fd90..f4f017c 100644 --- a/originator.c +++ b/originator.c @@ -457,7 +457,7 @@ static int orig_node_del_if(struct orig_node *orig_node, memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
/* copy second part */ - memcpy(data_ptr, + memcpy(data_ptr + del_if_num * chunk_size, orig_node->bcast_own + ((del_if_num + 1) * chunk_size), (max_if_num - del_if_num) * chunk_size);
@@ -477,7 +477,7 @@ free_bcast_own: memcpy(data_ptr, orig_node->bcast_own_sum, del_if_num * sizeof(uint8_t));
- memcpy(data_ptr, + memcpy(data_ptr + del_if_num * sizeof(uint8_t), orig_node->bcast_own_sum + ((del_if_num + 1) * sizeof(uint8_t)), (max_if_num - del_if_num) * sizeof(uint8_t));