b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: greg@kroah.com
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
Date: Tue, 19 Oct 2010 11:59:11 +0200	[thread overview]
Message-ID: <1287482355-16319-4-git-send-email-sven.eckelmann@gmx.de> (raw)
In-Reply-To: <1287482355-16319-1-git-send-email-sven.eckelmann@gmx.de>

From: Linus Lüssing <linus.luessing@web.de>

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>
---
 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));
 
-- 
1.7.2.3


  parent reply	other threads:[~2010-10-19  9:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  9:59 [B.A.T.M.A.N.] Staging: batman-adv for 2.6.37 (4) Sven Eckelmann
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 1/7] Staging: batman-adv: Add hash recommendations to TODO Sven Eckelmann
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 2/7] Staging: batman-adv: Don't dereference unchecked incoming soft_iface Sven Eckelmann
2010-10-19  9:59 ` Sven Eckelmann [this message]
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 4/7] Staging: batman-adv: document fragmentation sysfs API Sven Eckelmann
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 5/7] Staging: batman-adv: protect against ogm packet overflow by checking table length Sven Eckelmann
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 6/7] Staging: batman-adv: fix crash when new OGM is generated Sven Eckelmann
2010-10-19  9:59 ` [B.A.T.M.A.N.] [PATCH 7/7] Staging: batman-adv: process OGMs bigger than MAX_AGGREGATION_BYTES Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287482355-16319-4-git-send-email-sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=greg@kroah.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).