From patchwork Sat Oct 29 08:06:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 122530 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8249DB6F6F for ; Sat, 29 Oct 2011 19:18:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219Ab1J2INp (ORCPT ); Sat, 29 Oct 2011 04:13:45 -0400 Received: from nm17.bullet.mail.ukl.yahoo.com ([217.146.183.191]:24629 "HELO nm17.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754055Ab1J2INo (ORCPT ); Sat, 29 Oct 2011 04:13:44 -0400 X-Greylist: delayed 364 seconds by postgrey-1.27 at vger.kernel.org; Sat, 29 Oct 2011 04:13:44 EDT Received: from [217.146.183.208] by nm17.bullet.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:37 -0000 Received: from [77.238.184.78] by tm1.bullet.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:37 -0000 Received: from [127.0.0.1] by smtp147.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1319875657; bh=pKWZ7BJwo8EVWXOyZvVCYTxjJxEkJTmeGJtZmOC+Vbg=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=wzHeEtjSwhQ+CRr/oXTvwJUnlMAfyLccBT5X/yNL64ahpAw7sH4wQFy+ZT+cjJAbzKj6Jj72IDN7mFj9JFL8dRClQ2Q0yDZgBrOhDJdchtV57uOSrzsxzNnN1uleIt9z8axBo/9Ep9p9KdtpseprtZUr6QuEalhZz9ytgRLXkno= X-Yahoo-Newman-Id: 729906.91738.bm@smtp147.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: xaYUiPgVM1lNlsaKNp6UgHi9eoSYKkFYeefE_9RGM6NUKf. RsJtLilj_MUlEDWEyrTyGJJn_I1n41thHO2BBHgObfI6lkDVYLY8LzPg7w.X BGZVLaGyV0KSynjzpsPCdLasCoHfTTz3SC2BSq2hdT_ZD6Ww8gcW4WlgIXMB eBwbOJTWD61ATTH.OFYA5_hTKUJt_r.ATdEqfEUBsvsng0Qbi4fFkz.j6ExZ HlzSfoy.SU7rCksoE0Vpduyy_.5ztNH0f07CjTAOc6Jgwc1yjBdNs7_2VYkw _YgsrXnPXPk.l..w.cp0LRSJ0MPxIOLZ1k8NFEUrLB8vWtd7QmtL20BVyMNm 8zqCTstEhmR2Af1KD1T4OUdbBOIaY7PhTMm3894YMl54fed6.kDnkS.k- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@78.46.248.235 with plain) by smtp147.mail.ukl.yahoo.com with SMTP; 29 Oct 2011 08:07:36 +0000 GMT From: Marek Lindner To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, stable@kernel.org, Antonio Quartulli , Marek Lindner Subject: [PATCH 3/3] batman-adv: unify hash_entry field position in tt_local/global_entry Date: Sat, 29 Oct 2011 10:06:46 +0200 Message-Id: <1319875606-7794-4-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1319875606-7794-1-git-send-email-lindner_marek@yahoo.de> References: <1319875606-7794-1-git-send-email-lindner_marek@yahoo.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Antonio Quartulli Function tt_response_fill_table() actually uses a tt_local_entry pointer to iterate either over the local or the global table entries (it depends on the what hash table is passed as argument). To iterate over such entries the hlist_for_each_entry_rcu() macro has to access their "hash_entry" field which MUST be at the same position in both the tt_global/local_entry structures. Reported-by: Simon Wunderlich Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/types.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 1ae3557..ab8d0fe 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -224,22 +224,22 @@ struct socket_packet { struct tt_local_entry { uint8_t addr[ETH_ALEN]; + struct hlist_node hash_entry; unsigned long last_seen; uint16_t flags; atomic_t refcount; struct rcu_head rcu; - struct hlist_node hash_entry; }; struct tt_global_entry { uint8_t addr[ETH_ALEN]; + struct hlist_node hash_entry; /* entry in the global table */ struct orig_node *orig_node; uint8_t ttvn; uint16_t flags; /* only TT_GLOBAL_ROAM is used */ unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ atomic_t refcount; struct rcu_head rcu; - struct hlist_node hash_entry; /* entry in the global table */ }; struct tt_change_node {