The packet aggregation needs to ensure that only compatible packets
are aggregated. Some of the checks are based on the interface number
while assuming that the first interface also is the primary interface
which is not always the case.
This patch addresses the issue by using the primary_if pointer.
Reported-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
---
aggregation.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/aggregation.c b/aggregation.c
index c583e04..69467fe 100644
--- a/aggregation.c
+++ b/aggregation.c
@@ -28,6 +28,7 @@
/* return true if new_packet can be aggregated with forw_packet */
static bool can_aggregate_with(const struct batman_packet *new_batman_packet,
+ struct bat_priv *bat_priv,
int packet_len,
unsigned long send_time,
bool directlink,
@@ -37,6 +38,8 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet,
struct batman_packet *batman_packet =
(struct batman_packet *)forw_packet->skb->data;
int aggregated_bytes = forw_packet->packet_len + packet_len;
+ struct hard_iface *primary_if = NULL;
+ bool res = false;
/**
* we can aggregate the current packet to this aggregated packet
@@ -61,6 +64,10 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet,
* packet
*/
+ primary_if = primary_if_get_selected(bat_priv);
+ if (!primary_if)
+ goto out;
+
/* packets without direct link flag and high TTL
* are flooded through the net */
if ((!directlink) &&
@@ -70,8 +77,10 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet,
/* own packets originating non-primary
* interfaces leave only that interface */
((!forw_packet->own) ||
- (forw_packet->if_incoming->if_num == 0)))
- return true;
+ (forw_packet->if_incoming == primary_if))) {
+ res = true;
+ goto out;
+ }
/* if the incoming packet is sent via this one
* interface only - we still can aggregate */
@@ -84,11 +93,16 @@ static bool can_aggregate_with(const struct batman_packet *new_batman_packet,
* (= secondary interface packets in general) */
(batman_packet->flags & DIRECTLINK ||
(forw_packet->own &&
- forw_packet->if_incoming->if_num != 0)))
- return true;
+ forw_packet->if_incoming != primary_if))) {
+ res = true;
+ goto out;
+ }
}
- return false;
+out:
+ if (primary_if)
+ hardif_free_ref(primary_if);
+ return res;
}
/* create a new aggregated packet and add this packet to it */
@@ -210,6 +224,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
hlist_for_each_entry(forw_packet_pos, tmp_node,
&bat_priv->forw_bat_list, list) {
if (can_aggregate_with(batman_packet,
+ bat_priv,
packet_len,
send_time,
direct_link,
--
1.7.5.3
Hi all,
I setup the virtual interface bat0 which embeds wlan0 for my system.
As described in the batman-adv README file, I did
# insmod batman-adv.ko and
# echo bat0 > /sys/class/net/wlan0/batman_adv/mesh_iface
I can thus enable bat0 interface and start the batman-adv protocol in
multihop environment.
However, when I restart the computer, I need to again load the kernel
module and start the process from beginning.
I would like to run bat0 interface directly after restarting the
computer (like we have it for wlan0 or eth0)
Could you please help me how do I do this?
Thanks in advance
Max
This patchset introduces the AP-isolation functionality. As for common access
points, the AP-isolation is a mechanism that prevents clients to communicate
to each other. In batman-adv the AP-isolation, if activated, will prevent
"WIFI bridged-in clients" to communicate with any other "WIFI bridged-in
client".
The first patch introduces a mechanism which permit to detect the interface type
used by a client and to possibly mark its tt_local_entry in case of WIFI. This
information is then spread over the network within the TT announcements.
The other two patches implement the AP-isolation mechanism which exploits the
WIFI mark (on tt_entries) to prevent communications between WIFI clients.
The "AP-isolation check" is done either on the receiver and on the sender side.
Best regards,
Antonio Quartulli
I cannot speak on behalf of the batman-adv developers due to conflicts
in the opinion about the ongoing development. The batman-adv module is
still maintained by Marek Lindner and Simon Wunderlich. Those are the
main persons behind the visions of batman-adv. Therefore, the state of
module hasn't changed.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Cc: b.a.t.m.a.n(a)lists.open-mesh.org
---
Just as small background information:
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2011-June/005020.html
expresses the same problems I have with the changes and I can honestly
not speak on behalf the developers when I my inner mind is against the
changes and I would only be an additional, unneeded barrier.
This decission was made in context of the changes which are on the
horizon. I personally don't know what is coming, but that many things
are changing in an incompatible way. I would like to leave here instead
to destroy some friendships.
MAINTAINERS | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index dc2a7c8..9597832 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1390,7 +1390,6 @@ F: include/linux/backlight.h
BATMAN ADVANCED
M: Marek Lindner <lindner_marek(a)yahoo.de>
M: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
-M: Sven Eckelmann <sven(a)narfation.org>
L: b.a.t.m.a.n(a)lists.open-mesh.org
W: http://www.open-mesh.org/
S: Maintained
--
1.7.5.3