diff options
author | Linus Lüssing <linus.luessing@web.de> | 2010-10-19 09:59:11 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-19 17:04:16 (GMT) |
commit | 5dfa2ba9e658f099c11eab251da348429f6a9d7d (patch) | |
tree | 20fde2d130265b6ca980838f70ac20d60eb79501 | |
parent | 9b37bc2c711b2a76ef3daa9437bbf9c58411afbd (diff) | |
download | linux-5dfa2ba9e658f099c11eab251da348429f6a9d7d.tar.xz |
Staging: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/batman-adv/originator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c index c530df1..865211d 100644 --- a/drivers/staging/batman-adv/originator.c +++ b/drivers/staging/batman-adv/originator.c @@ -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)); |