public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: avoid ap_isolated check for broadcast packet
@ 2012-03-05  7:51 Antonio Quartulli
  2012-03-05 19:52 ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2012-03-05  7:51 UTC (permalink / raw)
  To: b.a.t.m.a.n

in case of a broadcast packet, the result of the ap_isolated check is always
false (since we have no ff:ff:ff:ff:ff:ff client to check for TT_CLIENT_WIFI),
therefore we can avoid searching the translation table and we can return false
directly

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

- Yes, it's just an optimisation that aims to avoid accessing the hash table
  when we already know that it is not needed.


 translation-table.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 9a07882..2e16882 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -2034,6 +2034,11 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
 	if (!atomic_read(&bat_priv->ap_isolation))
 		return false;
 
+	/* if we are dealing with a broadcast packet, we can avoid to search the
+	 * translation table */
+	if (is_broadcast_ether_addr(dst))
+		return false;
+
 	tt_local_entry = tt_local_hash_find(bat_priv, dst);
 	if (!tt_local_entry)
 		goto out;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-05 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05  7:51 [B.A.T.M.A.N.] [PATCH] batman-adv: avoid ap_isolated check for broadcast packet Antonio Quartulli
2012-03-05 19:52 ` Marek Lindner
2012-03-05 23:11   ` Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox