From patchwork Tue Oct 19 09:59:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 452 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.org (Postfix) with SMTP id 1503315456C for ; Tue, 19 Oct 2010 11:58:50 +0200 (CEST) Received: (qmail invoked by alias); 19 Oct 2010 09:58:49 -0000 Received: from vpnclient-202-098.hrz.tu-chemnitz.de (EHLO sven-desktop.lazhur.ath.cx) [134.109.202.98] by mail.gmx.net (mp039) with SMTP; 19 Oct 2010 11:58:49 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX18Z/ZZlTMQZLVFuqnpeM35iYBicfJCpWtnNHXQcSS TQX51tmSJ7/mt7 From: Sven Eckelmann To: greg@kroah.com Date: Tue, 19 Oct 2010 11:59:11 +0200 Message-Id: <1287482355-16319-4-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1287482355-16319-1-git-send-email-sven.eckelmann@gmx.de> References: <1287482355-16319-1-git-send-email-sven.eckelmann@gmx.de> MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Cc: b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 3/7] Staging: batman-adv: Fix resizing of broadcast seqno buffers on if deletion X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2010 09:58:50 -0000 From: Linus Lüssing 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 Signed-off-by: Sven Eckelmann --- 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));