Staging: batman-adv: Fix resizing of broadcast seqno buffers on if deletion
authorLinus Lüssing <linus.luessing@web.de>
Tue, 19 Oct 2010 09:59:11 +0000 (11:59 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 19 Oct 2010 17:04:16 +0000 (10:04 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/originator.c

index c530df12e03ec64453716e4ed64ae3bf2f7ab4d6..865211ddd8d22494b365f21e31c78a965342a015 100644 (file)
@@ -456,7 +456,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);
 
@@ -476,7 +476,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));