batman-adv: stability patches
[openwrt/svn-archive/archive.git] / net / batman-adv / patches / 0002-batman-adv-only-drop-packets-of-known-wifi-clients.patch
1 From 7c6c6db94848497178cc246585b59fad4368c3e2 Mon Sep 17 00:00:00 2001
2 From: Marek Lindner <lindner_marek@yahoo.de>
3 Date: Wed, 20 Jun 2012 16:56:04 +0200
4 Subject: [PATCH] batman-adv: only drop packets of known wifi clients
5
6 If the source or destination mac address of an ethernet packet
7 could not be found in the translation table the packet was
8 dropped if AP isolation was turned on. This behavior would
9 make it impossible to send broadcast packets over the mesh
10 as the broadcast address will never enter the translation
11 table.
12
13 Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
14 ---
15 translation-table.c | 8 ++++----
16 1 files changed, 4 insertions(+), 4 deletions(-)
17
18 diff --git a/translation-table.c b/translation-table.c
19 index a66c2dc..660c40f 100644
20 --- a/translation-table.c
21 +++ b/translation-table.c
22 @@ -2031,10 +2031,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
23 {
24 struct tt_local_entry *tt_local_entry = NULL;
25 struct tt_global_entry *tt_global_entry = NULL;
26 - bool ret = true;
27 + bool ret = false;
28
29 if (!atomic_read(&bat_priv->ap_isolation))
30 - return false;
31 + goto out;
32
33 tt_local_entry = tt_local_hash_find(bat_priv, dst);
34 if (!tt_local_entry)
35 @@ -2044,10 +2044,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
36 if (!tt_global_entry)
37 goto out;
38
39 - if (_is_ap_isolated(tt_local_entry, tt_global_entry))
40 + if (!_is_ap_isolated(tt_local_entry, tt_global_entry))
41 goto out;
42
43 - ret = false;
44 + ret = true;
45
46 out:
47 if (tt_global_entry)
48 --
49 1.7.9.1
50