batman-adv: update package to latest release (2011.4.0)

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>



git-svn-id: svn://svn.openwrt.org/openwrt/packages@29118 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
marek 2011-11-14 15:52:12 +00:00
parent 15e4119bdb
commit b265d99a29
6 changed files with 11 additions and 132 deletions

View File

@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv
PKG_VERSION:=2011.3.1
BATCTL_VERSION:=2011.3.0
PKG_MD5SUM:=54a5caff56a8380f3070111ce84bbfc4
BATCTL_MD5SUM:=8eb197896049bb04a6beef56015a16b6
PKG_VERSION:=2011.4.0
BATCTL_VERSION:=2011.4.0
PKG_MD5SUM:=3987d693bd26d8057506b542c3635910
BATCTL_MD5SUM:=325b25dbb8261f7fa19c6e1d9bfba6e1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)

View File

@ -2,6 +2,7 @@
config 'mesh' 'bat0'
option 'interfaces' 'mesh'
option 'aggregated_ogms'
option 'ap_isolation'
option 'bonding'
option 'fragmentation'
option 'gw_bandwidth'

View File

@ -13,13 +13,14 @@ is_module_loaded() {
start_mesh () {
local meshif="$1"
local interfaces aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval vis_mode
local interfaces aggregated_ogms ap_isolation bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval vis_mode
is_module_loaded
[ $? -ne 1 ] && return
config_get interfaces "$meshif" interfaces
config_get aggregated_ogms "$meshif" aggregated_ogms
config_get ap_isolation "$meshif" ap_isolation
config_get bonding "$meshif" bonding
config_get fragmentation "$meshif" fragmentation
config_get gw_bandwidth "$meshif" gw_bandwidth
@ -57,6 +58,10 @@ start_mesh () {
echo $aggregated_ogms > /sys/class/net/$meshif/mesh/aggregated_ogms
fi
if [ $ap_isolation ]; then
echo $ap_isolation > /sys/class/net/$meshif/mesh/ap_isolation
fi
if [ $bonding ]; then
echo $bonding > /sys/class/net/$meshif/mesh/bonding
fi

View File

@ -1,41 +0,0 @@
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 <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
types.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- a/types.h
+++ b/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 {

View File

@ -1,23 +0,0 @@
After removing the batman-adv module, the hash may be already gone
when tt_global_del_orig() tries to clean the hash. This patch adds
a sanity check to avoid this.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
translation-table.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
--- a/translation-table.c
+++ b/translation-table.c
@@ -712,6 +712,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
+ if (!hash)
+ return;
+
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
list_lock = &hash->list_locks[i];

View File

@ -1,63 +0,0 @@
struct tt_global_entry holds a reference to an orig_node which must be
decremented before deallocating the structure.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
compat.c | 8 --------
compat.h | 1 -
translation-table.c | 14 +++++++++++++-
3 files changed, 13 insertions(+), 10 deletions(-)
--- a/compat.c
+++ b/compat.c
@@ -36,12 +36,4 @@ void free_rcu_tt_local_entry(struct rcu_head *rcu)
kfree(tt_local_entry);
}
-void free_rcu_tt_global_entry(struct rcu_head *rcu)
-{
- struct tt_global_entry *tt_global_entry;
-
- tt_global_entry = container_of(rcu, struct tt_global_entry, rcu);
- kfree(tt_global_entry);
-}
-
#endif /* < KERNEL_VERSION(3, 0, 0) */
--- a/compat.h
+++ b/compat.h
@@ -63,7 +63,6 @@ void free_rcu_gw_node(struct rcu_head *rcu);
void free_rcu_neigh_node(struct rcu_head *rcu);
void free_rcu_softif_neigh(struct rcu_head *rcu);
void free_rcu_tt_local_entry(struct rcu_head *rcu);
-void free_rcu_tt_global_entry(struct rcu_head *rcu);
#endif /* < KERNEL_VERSION(3, 0, 0) */
--- a/translation-table.c
+++ b/translation-table.c
@@ -137,10 +137,22 @@ static void tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry)
kfree_rcu(tt_local_entry, rcu);
}
+static void tt_global_entry_free_rcu(struct rcu_head *rcu)
+{
+ struct tt_global_entry *tt_global_entry;
+
+ tt_global_entry = container_of(rcu, struct tt_global_entry, rcu);
+
+ if (tt_global_entry->orig_node)
+ orig_node_free_ref(tt_global_entry->orig_node);
+
+ kfree(tt_global_entry);
+}
+
static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry)
{
if (atomic_dec_and_test(&tt_global_entry->refcount))
- kfree_rcu(tt_global_entry, rcu);
+ call_rcu(&tt_global_entry->rcu, tt_global_entry_free_rcu);
}
static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr,