From patchwork Sun Oct 10 04:30:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 447 Return-Path: Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227]) by open-mesh.org (Postfix) with ESMTP id 73559154543 for ; Sun, 10 Oct 2010 06:31:19 +0200 (CEST) Received: from smtp02.web.de ( [172.20.0.184]) by fmmailgate02.web.de (Postfix) with ESMTP id 43A8C17707A7F for ; Sun, 10 Oct 2010 06:30:38 +0200 (CEST) Received: from [46.126.246.98] (helo=localhost) by smtp02.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #4) id 1P4nYT-0006bj-00; Sun, 10 Oct 2010 06:30:38 +0200 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 10 Oct 2010 06:30:01 +0200 Message-Id: <1286685001-15227-5-git-send-email-linus.luessing@web.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1286685001-15227-1-git-send-email-linus.luessing@web.de> References: <1286685001-15227-1-git-send-email-linus.luessing@web.de> MIME-Version: 1.0 Sender: linus.luessing@web.de X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX18DhIyMef93MjWJLvHd8IKLrqW+fBuj0Zzt7aMy hF6KiE1PpD1C1eF0hJ47agkClUshlNzKmsIgWZlxQ1aiooMrfr UdXli9wBIKLLlgy5zhfw== Subject: [B.A.T.M.A.N.] [PATCH 5/5] 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: Sun, 10 Oct 2010 04:31:19 -0000 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 --- originator.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/originator.c b/originator.c index a7b74f0..6868a2a 100644 --- a/originator.c +++ b/originator.c @@ -465,7 +465,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); @@ -485,7 +485,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));