All taken from batman-adv master (b08dc3d9452d28944e7db09c2005c633b63f55e9)
1. multicast.c (dereference of NULL orig_node on at least the first round):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
orig_node = NULL before the first entry in hlist_for_each_entry_rcu. NULL
dereferenced in atomic_inc_not_zero(...) to get the refcount
Was introduced with 45dab5f5509023946793fc9d1d0566c12ca8bb52
("batman-adv: fix more code style")
Code section:
============
static struct batadv_orig_node *
batadv_mcast_forw_unsnoop_node_get(struct batadv_priv *bat_priv)
{
struct batadv_orig_node *tmp_orig_node, *orig_node = NULL;
rcu_read_lock();
hlist_for_each_entry_rcu(tmp_orig_node,
&bat_priv->mcast.want_all_unsnoopables_list,
mcast_want_all_unsnoopables_node) {
if (!atomic_inc_not_zero(&orig_node->refcount))
continue;
orig_node = tmp_orig_node;
break;
}
rcu_read_unlock();
return orig_node;
}
Solution:
========
Change atomic_inc_not_zero from orig_node to tmp_orig_node
2. multicast.c (dereference of NULL orig_node on at least the first round):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
orig_node = NULL before the first entry in hlist_for_each_entry_rcu. NULL
dereferenced in atomic_inc_not_zero(...) to get the refcount
Was introduced with 45dab5f5509023946793fc9d1d0566c12ca8bb52
("batman-adv: fix more code style")
Code section:
============
static struct batadv_orig_node *
batadv_mcast_forw_ipv6_node_get(struct batadv_priv *bat_priv)
{
struct batadv_orig_node *tmp_orig_node, *orig_node = NULL;
rcu_read_lock();
hlist_for_each_entry_rcu(tmp_orig_node,
&bat_priv->mcast.want_all_ipv6_list,
mcast_want_all_ipv6_node) {
if (!atomic_inc_not_zero(&orig_node->refcount))
continue;
orig_node = tmp_orig_node;
break;
}
rcu_read_unlock();
return orig_node;
}
Solution:
========
Change atomic_inc_not_zero from orig_node to tmp_orig_node
3. multicast.c (dereference of NULL orig_node on at least the first round):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
orig_node = NULL before the first entry in hlist_for_each_entry_rcu. NULL
dereferenced in atomic_inc_not_zero(...) to get the refcount
Was introduced with 45dab5f5509023946793fc9d1d0566c12ca8bb52
("batman-adv: fix more code style")
Code section:
============
static struct batadv_orig_node *
batadv_mcast_forw_ipv4_node_get(struct batadv_priv *bat_priv)
{
struct batadv_orig_node *tmp_orig_node, *orig_node = NULL;
rcu_read_lock();
hlist_for_each_entry_rcu(tmp_orig_node,
&bat_priv->mcast.want_all_ipv4_list,
mcast_want_all_ipv4_node) {
if (!atomic_inc_not_zero(&orig_node->refcount))
continue;
orig_node = tmp_orig_node;
break;
}
rcu_read_unlock();
return orig_node;
}
Solution:
========
Change atomic_inc_not_zero from orig_node to tmp_orig_node
4. originator.c (Indirect hard_iface NULL dereference):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hard_iface is NULL and goto out is made. batadv_hardif_free_ref doesn't
check for NULL before dereferencing it to get to refcount.
Introduced in f13f960797fd1969b3c0470cc97435ddfb6aecb4
("batman-adv: add debugfs support to view multiif tables").
Code section:
============
int batadv_orig_hardif_seq_print_text(struct seq_file *seq, void *offset)
{
struct net_device *net_dev = (struct net_device *)seq->private;
struct batadv_hard_iface *hard_iface;
struct batadv_priv *bat_priv;
hard_iface = batadv_hardif_get_by_netdev(net_dev);
if (!hard_iface || !hard_iface->soft_iface) {
seq_puts(seq, "Interface not known to B.A.T.M.A.N.\n");
goto out;
}
[...]
out:
batadv_hardif_free_ref(hard_iface);
return 0;
}
Solution:
========
if (hard_iface)
batadv_hardif_free_ref(hard_iface);
Related code section:
====================
static inline void
batadv_hardif_free_ref_now(struct batadv_hard_iface *hard_iface)
{
if (atomic_dec_and_test(&hard_iface->refcount))
batadv_hardif_free_rcu(&hard_iface->rcu);
}
5. BONUS: fragmentation.c (Impossible code section marked likely):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
frag_entry_curr is iterator used for list chain->head. This loop is
only stopped when the list ends and frag_entry_curr is NULL. The next
section following the loop says that it is likely that frag_entry_curr
is NOT NULL. This is a contradiction.
Introduced in 9b3eab61754d74a93c9840c296013fe3b4a1b606
("batman-adv: Receive fragmented packets and merge")
Code section:
============
static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,
struct sk_buff *skb,
struct hlist_head *chain_out)
{
[...]
/* Find the position for the new fragment. */
hlist_for_each_entry(frag_entry_curr, &chain->head, list) {
/* Drop packet if fragment already exists. */
if (frag_entry_curr->no == frag_entry_new->no)
goto err_unlock;
/* Order fragments from highest to lowest. */
if (frag_entry_curr->no < frag_entry_new->no) {
hlist_add_before(&frag_entry_new->list,
&frag_entry_curr->list);
chain->size += skb->len - hdr_size;
chain->timestamp = jiffies;
ret = true;
goto out;
}
}
/* Reached the end of the list, so insert after 'frag_entry_curr'. */
if (likely(frag_entry_curr)) {
hlist_add_after(&frag_entry_curr->list, &frag_entry_new->list);
chain->size += skb->len - hdr_size;
chain->timestamp = jiffies;
ret = true;
}
[...]
}
Solution:
========
Rewrite this part to track the last seen batadv_frag_list_entry and add it
after that. The empty list should already handled earlier in the scope
starting with
if (batadv_frag_init_chain(chain, seqno)) {
Related code section:
====================
#define hlist_for_each_entry(pos, head, member) \
for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)),
member))
To give users an additional hint if the multicast feature is not
compiled in, to let them know what they can do to change that.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
---
functions.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/functions.c b/functions.c
index 117dcff..b9ccaff 100644
--- a/functions.c
+++ b/functions.c
@@ -63,6 +63,7 @@ const char *fs_compile_out_param[] = {
batctl_settings[BATCTL_SETTINGS_BLA].sysfs_name,
batctl_settings[BATCTL_SETTINGS_DAT].sysfs_name,
batctl_settings[BATCTL_SETTINGS_NETWORK_CODING].sysfs_name,
+ batctl_settings[BATCTL_SETTINGS_MULTICAST_MODE].sysfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_CLAIMS].debugfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name,
batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name,
--
1.7.10.4
The "Expected throughput" towards a generic wireless peer is
a value that can be used by other kernel components to
achieve different goals.
In particular we have 802.11s and batman-adv which will
iuse this estimation to compute their throughput based
metric. Therefore with this patchset I wanted to export
this result and make it available for future use.
Changes included in this patchset:
- add the new get_expected_throughput() RC API
- export the result of such API via cfg80211::get_station()
- implement the get_expected_throughput() RC API for minstrel(_ht)
For what concerns Minstrel_HT I decided to directly re-use the
throughput value computed by the algorithm itself with
minstrel_ht_calc_tp() for max_tp_rate.
For the legacy Minstrel instead I computed the expected
throughput as the product of the max_tp bitrate multplied
by its probability of success.
I am not entirely sure about passing sband as third parameter
to get_expected_throughput()..maybe somebody can suggest a
better solution.
Cheers,
Antonio Quartulli (6):
cfg80211: export expected throughput through get_station()
mac80211: add new RC API to retrieve expected throughput
mac80211: export expected throughput in set_sta_info()
mac80211: minstrel - implement get_expected_throughput() API
mac80211: minstrel_ht - implement get_expected_throughput() API
cfg80211: implement cfg80211_get_station cfg80211 API
include/net/cfg80211.h | 74 +++++++++++++++++++++++---------------
include/net/mac80211.h | 3 ++
net/mac80211/cfg.c | 17 +++++++++
net/mac80211/rc80211_minstrel.c | 15 ++++++++
net/mac80211/rc80211_minstrel_ht.c | 19 ++++++++++
net/wireless/util.c | 18 ++++++++++
6 files changed, 118 insertions(+), 28 deletions(-)
--
1.8.3.2
Hello again friendly devs,
here we are, after a long "running stable" hiatus, back into the
bleeding edge for a ride \o/
running a small cloud of recent openwrt trunk (r40361)
(OT: kmod-ath9k is running suprisingly smooth! yay!!)
with kmod-batman-adv - 3.10.34+2014.1.0-2
and, well... i have bat news :P
1) yesterday i saw something vaguely reminiscent to the old OGM starving
issue: in a line of 4 guinea-pig nodes that flow through a river of
DeltaLibre, the 4th node would get TQ=1 for the 1st node, and would not
even ping it (i can't remember the result of batctl ping, maybe it did),
even though the links were really solid (TQ>220 on every one-hop-link of
the chain)
(the 3rd node was seeing the 1st with TQ>200, and could batctl ping /
ping perfectly)
at that point i found out kmod-batman-adv was inadvertently compiled
without log support :( so that's as much as i can report for now, i'll
recompile with that enabled and follow up.
2) this morning, in 2-node cloud testbed at home, uptime=22hs, The
Bizarre Behaviour showed up and is sharing breakfast with me.
on one side, lying calmly on the floor...
root@rockm5:~# batctl o
[B.A.T.M.A.N. adv 2014.1.0, MainIF/MAC: wlan0_adhoc.11/dc:9f:db:9c:37:54
(bat0 BATMAN_IV)]
Originator last-seen (#/255) Nexthop [outgoingIF]:
Potential nexthops ...
64:70:02:ed:f8:ea 0.770s (255) 64:70:02:ed:f8:ea [wlan0_adhoc.11]:
64:70:02:ed:f8:ea (255)
02:00:49:ed:f8:e8 0.320s (255) 64:70:02:ed:f8:ea [wlan0_adhoc.11]:
64:70:02:ed:f8:ea (255)
root@rockm5:~# batctl if
wlan0_adhoc.11: active
2 meters away, a TL-WDR3600 lurks...
root@planit:~# batctl o
[B.A.T.M.A.N. adv 2014.1.0, MainIF/MAC: eth0.1.11/02:00:49:ed:f8:e8
(bat0 BATMAN_IV)]
Originator last-seen (#/255) Nexthop [outgoingIF]:
Potential nexthops ...
dc:9f:db:9c:37:54 0.360s (255) dc:9f:db:9c:37:54 [wlan1_adhoc.11]:
dc:9f:db:9c:37:54 (255)
root@planit:~# batctl if
eth0.1.11: active
wlan1_adhoc.11: active
wlan0_adhoc.11: active
### rockm5 global ip over br-lan: gave its last breath
root@planit:~# ip -6 r get 2a00:1508:1:f804::9d:3754/64
2a00:1508:1:f804::9d:3754 from :: dev br-lan src
2a00:1508:1:f804::ed:f8e8 metric 0
root@planit:~# ping 2a00:1508:1:f804::9d:3754
PING 2a00:1508:1:f804::9d:3754 (2a00:1508:1:f804::9d:3754): 56 data bytes
--- 2a00:1508:1:f804::9d:3754 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss
### rockm5 link-local over br-lan: feeding the daisies
root@planit:~# ping6 fe80::de9f:dbff:fe9d:3754%br-lan
PING fe80::de9f:dbff:fe9d:3754%br-lan(fe80::de9f:dbff:fe9d:3754) 56 data
bytes
--- fe80::de9f:dbff:fe9d:3754%br-lan ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2001ms
### lower level link-local works fine (avoiding batman-adv)
root@planit:~# ping6 fe80::de9f:dbff:fe9c:3754%wlan1_adhoc.11
PING fe80::de9f:dbff:fe9c:3754%wlan1_adhoc.11(fe80::de9f:dbff:fe9c:3754)
56 data bytes
64 bytes from fe80::de9f:dbff:fe9c:3754: icmp_seq=1 ttl=64 time=2.70 ms
64 bytes from fe80::de9f:dbff:fe9c:3754: icmp_seq=2 ttl=64 time=1.39 ms
--- fe80::de9f:dbff:fe9c:3754%wlan1_adhoc.11 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.398/2.053/2.708/0.655 ms
### batctl ping to rockm5 enjoys excellent health
root@planit:~# batctl ping dc:9f:db:9c:37:54
PING dc:9f:db:9c:37:54 (dc:9f:db:9c:37:54) 20(48) bytes of data
20 bytes from dc:9f:db:9c:37:54 icmp_seq=1 ttl=50 time=1.16 ms
20 bytes from dc:9f:db:9c:37:54 icmp_seq=2 ttl=50 time=0.90 ms
20 bytes from dc:9f:db:9c:37:54 icmp_seq=3 ttl=50 time=0.90 ms
^C--- dc:9f:db:9c:37:54 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss
rtt min/avg/max/mdev = 0.902/0.989/1.162/0.122 ms
well, as said before, i have no "batctl l" output to show, but will
collect and write chapter two.
With a bit of luck, what i described so far rings a bell on someone, and
can give an early insight
(maybe it's due to the way we are using vlans?)
(maybe its because routing_algo = BATMAN_IV?)
(maybe the rewritten code is designed to work this way? yay!)
(maybe it's our ugly hacky ebtables droppings / anygw magic that are
interacting badly in some way? can describe them in detail next time)
i must say tho, that this was running fine yesterday, and it broke
spontaneously without any manual intervention or config change.
oh, BLA2 and DAT are disabled on all nodes.
thanks as always,
and hope a giggle cheers up your day :)
gui
From: Antonio Quartulli <antonio(a)open-mesh.com>
When a VLAN interface (on top of batX) is removed and
re-added within a short timeframe TT does not have enough
time to properly cleanup. This creates an internal TT state
mismatch as the newly created softif_vlan will be
initialized from scratch with a TT client count of zero
(even if TT entries for this VLAN still exist). The
resulting TT messages are bogus due to the counter / tt
client listing mismatch, thus creating inconsistencies on
every node in the network
To fix this issue destroy_vlan() has to not free the VLAN
object immediately but it has to be kept alive until all the
TT entries for this VLAN have been removed. destroy_vlan()
still removes the sysfs folder so that the user has the
feeling that everything went fine.
If the same VLAN is re-added before the old object is free'd,
then the latter is resurrected and re-used.
Implement such behaviour by increasing the reference counter
of a softif_vlan object every time a new local TT entry for
such VLAN is created and remove the object from the list
only when all the TT entries have been destroyed.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
---
Changes since v2:
- remove cleanup_work member that is not needed anymore in this approach
- reword commit subject
- reword commit message (Thanks Marek!)
Changes since v1:
- destroy and create vlan sysfs folder within softif_vlan_destroy/create() to
avoid lock troubles with soft-interface destruction and delayed jobs.
soft-interface.c | 45 ++++++++++++++++++++++++++++++++-------------
translation-table.c | 26 ++++++++++++++++++++++++++
types.h | 2 ++
3 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c
index d962363..87e2371 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -437,10 +437,15 @@ out:
* possibly free it
* @softif_vlan: the vlan object to release
*/
-void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan)
+void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan)
{
- if (atomic_dec_and_test(&softif_vlan->refcount))
- kfree_rcu(softif_vlan, rcu);
+ if (atomic_dec_and_test(&vlan->refcount)) {
+ spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
+ hlist_del_rcu(&vlan->list);
+ spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock);
+
+ kfree_rcu(vlan, rcu);
+ }
}
/**
@@ -494,6 +499,7 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
if (!vlan)
return -ENOMEM;
+ vlan->bat_priv = bat_priv;
vlan->vid = vid;
atomic_set(&vlan->refcount, 1);
@@ -505,6 +511,10 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
return err;
}
+ spin_lock_bh(&bat_priv->softif_vlan_list_lock);
+ hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
+ spin_unlock_bh(&bat_priv->softif_vlan_list_lock);
+
/* add a new TT local entry. This one will be marked with the NOPURGE
* flag
*/
@@ -512,10 +522,6 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
bat_priv->soft_iface->dev_addr, vid,
BATADV_NULL_IFINDEX, BATADV_NO_MARK);
- spin_lock_bh(&bat_priv->softif_vlan_list_lock);
- hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
- spin_unlock_bh(&bat_priv->softif_vlan_list_lock);
-
return 0;
}
@@ -527,18 +533,13 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv,
struct batadv_softif_vlan *vlan)
{
- spin_lock_bh(&bat_priv->softif_vlan_list_lock);
- hlist_del_rcu(&vlan->list);
- spin_unlock_bh(&bat_priv->softif_vlan_list_lock);
-
- batadv_sysfs_del_vlan(bat_priv, vlan);
-
/* explicitly remove the associated TT local entry because it is marked
* with the NOPURGE flag
*/
batadv_tt_local_remove(bat_priv, bat_priv->soft_iface->dev_addr,
vlan->vid, "vlan interface destroyed", false);
+ batadv_sysfs_del_vlan(bat_priv, vlan);
batadv_softif_vlan_free_ref(vlan);
}
@@ -556,6 +557,8 @@ static int batadv_interface_add_vid(struct net_device *dev, __be16 proto,
unsigned short vid)
{
struct batadv_priv *bat_priv = netdev_priv(dev);
+ struct batadv_softif_vlan *vlan;
+ int ret;
/* only 802.1Q vlans are supported.
* batman-adv does not know how to handle other types
@@ -565,6 +568,22 @@ static int batadv_interface_add_vid(struct net_device *dev, __be16 proto,
vid |= BATADV_VLAN_HAS_TAG;
+ /* if a new vlan is getting created, but it is found in the list, it
+ * means that it was not deleted yet. Make batadv_softif_vlan_get()
+ * increase the refcounter by one and return
+ */
+ vlan = batadv_softif_vlan_get(bat_priv, vid);
+ if (vlan) {
+ ret = 0;
+ if (!vlan->kobj) {
+ ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan);
+ if (ret)
+ batadv_softif_vlan_free_ref(vlan);
+ }
+
+ return ret;
+ }
+
return batadv_softif_create_vlan(bat_priv, vid);
}
diff --git a/translation-table.c b/translation-table.c
index 959dde7..b689981 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -485,6 +485,7 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
struct batadv_priv *bat_priv = netdev_priv(soft_iface);
struct batadv_tt_local_entry *tt_local;
struct batadv_tt_global_entry *tt_global;
+ struct batadv_softif_vlan *vlan;
struct net_device *in_dev = NULL;
struct hlist_head *head;
struct batadv_tt_orig_list_entry *orig_entry;
@@ -544,6 +545,9 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if (!tt_local)
goto out;
+ /* increase the refcounter of the related vlan */
+ vlan = batadv_softif_vlan_get(bat_priv, vid);
+
batadv_dbg(BATADV_DBG_TT, bat_priv,
"Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n",
addr, BATADV_PRINT_VID(vid),
@@ -573,6 +577,7 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if (unlikely(hash_added != 0)) {
/* remove the reference for the hash */
batadv_tt_local_entry_free_ref(tt_local);
+ batadv_softif_vlan_free_ref(vlan);
goto out;
}
@@ -978,6 +983,7 @@ uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv,
{
struct batadv_tt_local_entry *tt_local_entry;
uint16_t flags, curr_flags = BATADV_NO_FLAGS;
+ struct batadv_softif_vlan *vlan;
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
if (!tt_local_entry)
@@ -1008,6 +1014,11 @@ uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv,
hlist_del_rcu(&tt_local_entry->common.hash_entry);
batadv_tt_local_entry_free_ref(tt_local_entry);
+ /* decrease the reference held for this vlan */
+ vlan = batadv_softif_vlan_get(bat_priv, vid);
+ batadv_softif_vlan_free_ref(vlan);
+ batadv_softif_vlan_free_ref(vlan);
+
out:
if (tt_local_entry)
batadv_tt_local_entry_free_ref(tt_local_entry);
@@ -1080,6 +1091,7 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
spinlock_t *list_lock; /* protects write access to the hash lists */
struct batadv_tt_common_entry *tt_common_entry;
struct batadv_tt_local_entry *tt_local;
+ struct batadv_softif_vlan *vlan;
struct hlist_node *node_tmp;
struct hlist_head *head;
uint32_t i;
@@ -1100,6 +1112,13 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
tt_local = container_of(tt_common_entry,
struct batadv_tt_local_entry,
common);
+
+ /* decrease the reference held for this vlan */
+ vlan = batadv_softif_vlan_get(bat_priv,
+ tt_common_entry->vid);
+ batadv_softif_vlan_free_ref(vlan);
+ batadv_softif_vlan_free_ref(vlan);
+
batadv_tt_local_entry_free_ref(tt_local);
}
spin_unlock_bh(list_lock);
@@ -3078,6 +3097,7 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
struct batadv_hashtable *hash = bat_priv->tt.local_hash;
struct batadv_tt_common_entry *tt_common;
struct batadv_tt_local_entry *tt_local;
+ struct batadv_softif_vlan *vlan;
struct hlist_node *node_tmp;
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
@@ -3106,6 +3126,12 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
tt_local = container_of(tt_common,
struct batadv_tt_local_entry,
common);
+
+ /* decrease the reference held for this vlan */
+ vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);
+ batadv_softif_vlan_free_ref(vlan);
+ batadv_softif_vlan_free_ref(vlan);
+
batadv_tt_local_entry_free_ref(tt_local);
}
spin_unlock_bh(list_lock);
diff --git a/types.h b/types.h
index 78370ab..c4aba2f 100644
--- a/types.h
+++ b/types.h
@@ -638,6 +638,7 @@ struct batadv_priv_nc {
/**
* struct batadv_softif_vlan - per VLAN attributes set
+ * @bat_priv: pointer to the mesh object
* @vid: VLAN identifier
* @kobj: kobject for sysfs vlan subdirectory
* @ap_isolation: AP isolation state
@@ -647,6 +648,7 @@ struct batadv_priv_nc {
* @rcu: struct used for freeing in a RCU-safe manner
*/
struct batadv_softif_vlan {
+ struct batadv_priv *bat_priv;
unsigned short vid;
struct kobject *kobj;
atomic_t ap_isolation; /* boolean */
--
1.8.3.2
Hi Dimar,
Please direct your question to the batman mailing list instead of
directly to me. That way, you can get help from a lot more people, and
also get help if I didn't have time to answer...
Nevertheless, I replied inline below.
On 2014-04-03 14:16, Dimar Jaime González Soto wrote:
> Hi Martin, I need to connect to my mesh network with non b.a.t.m.a.n
> nodes(specifically a tablet). I followed the instructions
> from http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide
> [1] and I configured a node creating a mesh-bridge interface. The
> interface, I think, allow the connection through eth0, but the what I
> want is a connection trough the wireless interface, and i don't know
> how to setup the network.
I am a little confused about your current setup. Can you please send us
(that is the batman mailing: b.a.t.m.a.n(a)lists.open-mesh.org), the
following information:
The output of "ip link"
The output of "batctl if"
The output of "brctl show"
That will make it possible for us to give you better information.
Thanks,
Martin