[B.A.T.M.A.N.] Batman with Ubiquiti SDK
by Mitar
Hi!
Ubiquiti provides OpenWrt based SDK for their firmware. To my
information, it contains some proprietary madwifi-based WiFi drivers
with some older OpenWrt version. My question is how it would be
possible to run Batman on top of their firmware (thus not latest
OpenWrt). As Batman is in kernel, is is enough kernel-backwards
compatible to be able to run also on older (2.6) kernel versions? For
olsrd it is much simpler: you just install olsrd package and this is
it.
Mitar
9 years, 10 months
[B.A.T.M.A.N.] link alternation when radios are not on batman-adv router?
by dan
I have an interesting hardware setup I'd like to explore.
Basically, I would like to take commodity ubiquiti and/or openmesh
hardware and build a mesh with two different node types, some having
just 1 radio and others having multiple radios, a standard node and a
super node.
the standard node is:
a picostation flashed to openwrt running batman-adv and running the
radio in Ad-Hoc mode. Alternately an OM2P flashed to openwrt. This
is the basic client radio
the super node is:
a group of picostations or nanostations, flashed openwrt in adhoc
mode, but acting only as the L2 transport with a router at the center
running batman-adv.
The idea is that the super nodes have multiple radios in multiple
channels and can take advantage of link alternation allowing super
nodes to keep much higher bandwidth between them while the standard
nodes are cheap. The 'router' MIGHT also have a radio for client
access (unifi station flashed to openwrt maybe, or an ALIX board)
The supernode will have more CPU and also be the target of
backhaul/shorthaul links to cut down on hop count. The main router
would also be a batman-adv device, probably an x86 server, and would
be the border router for the mesh.
some questions,
I know that the supernodes will have higher throughput capabilities
due to dual mesh radios, but how will batman-adv know this or how
would I tell it? Is the internal mechanism for determining the best
path going to take this into account? Is there a way to identify a
supernode as being a better path above and beyond the automatic
batman-adv mechanisms?
Is having separate radios connected to a batman-adv router going to
behave how I presume? That multiple node2node connections will be
identified and the links be alternated when appropriate?
If the supernodes have 2 mesh radios, 1 in 5Ghz and 1 in 2.4Ghz, then
the standard nodes will only be able to connect to the 2.4Ghz channel
which might make it inappropriate to do link alternating on these two
links because of the shared traffic. Should batman-adv automatically
stop alternating the tx/rx on these links when one of the channels
starts to get saturated?
some other info:
the supernodes may have a link directly to the main distribution
point, but may also be linked just to another supernode and not to the
main distribution point, or possibly both.
the supernodes are likely to have more than 2 mesh radios as some of
these could be direction antennas. A supernode might have 3x 2.4Ghz
radios for mesh, 2x 5Ghz radios for mesh, and a 2.4Ghz radio for
non-mesh clients. These would most likely all be connected to a
switch port and only be on a single ethernet interface as far as
batman-adv is concerned.
9 years, 11 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Correctly check return value from debugfs_create_dir
by Martin Hundebøll
The setup code in batadv_socket_setup() and debug_log_setup() wrongly
assumes that debugfs_create_file() returns !0 on error. Since it
actually returns a pointer on success[1], the following check should
be inverted.
Also, use the return value from the two setup functions in
batadv_debugfs_add_meshif().
[1] http://www.fsl.cs.sunysb.edu/kernel-api/re464.html
Signed-off-by: Martin Hundebøll <martin(a)hundeboll.net>
---
bat_debugfs.c | 11 +++++++----
icmp_socket.c | 4 ++--
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/bat_debugfs.c b/bat_debugfs.c
index cd636db..bd9325d 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -193,13 +193,13 @@ static int debug_log_setup(struct bat_priv *bat_priv)
d = debugfs_create_file("log", S_IFREG | S_IRUSR,
bat_priv->debug_dir, bat_priv, &log_fops);
- if (d)
+ if (!d)
goto err;
return 0;
err:
- return 1;
+ return -ENOMEM;
}
static void debug_log_cleanup(struct bat_priv *bat_priv)
@@ -347,8 +347,11 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
if (!bat_priv->debug_dir)
goto out;
- batadv_socket_setup(bat_priv);
- debug_log_setup(bat_priv);
+ if (batadv_socket_setup(bat_priv))
+ goto rem_attr;
+
+ if (debug_log_setup(bat_priv))
+ goto rem_attr;
for (bat_debug = mesh_debuginfos; *bat_debug; ++bat_debug) {
file = debugfs_create_file(((*bat_debug)->attr).name,
diff --git a/icmp_socket.c b/icmp_socket.c
index 3fad5aa..40c5e18 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -283,13 +283,13 @@ int batadv_socket_setup(struct bat_priv *bat_priv)
d = debugfs_create_file(ICMP_SOCKET, S_IFREG | S_IWUSR | S_IRUSR,
bat_priv->debug_dir, bat_priv, &fops);
- if (d)
+ if (!d)
goto err;
return 0;
err:
- return 1;
+ return -ENOMEM;
}
static void bat_socket_add_packet(struct socket_client *socket_client,
--
1.7.10.2
10 years
[B.A.T.M.A.N.] [PATCH] batman-adv: Use batctl indentation of bat_packettype
by Sven Eckelmann
The style of the indentation was changed in
206af118414355e867e725ea83bc3a2989db5a40
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
packet.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/packet.h b/packet.h
index 205879e..c90219c 100644
--- a/packet.h
+++ b/packet.h
@@ -23,14 +23,14 @@
#define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
enum bat_packettype {
- BAT_IV_OGM = 0x01,
- BAT_ICMP = 0x02,
- BAT_UNICAST = 0x03,
- BAT_BCAST = 0x04,
- BAT_VIS = 0x05,
+ BAT_IV_OGM = 0x01,
+ BAT_ICMP = 0x02,
+ BAT_UNICAST = 0x03,
+ BAT_BCAST = 0x04,
+ BAT_VIS = 0x05,
BAT_UNICAST_FRAG = 0x06,
- BAT_TT_QUERY = 0x07,
- BAT_ROAM_ADV = 0x08
+ BAT_TT_QUERY = 0x07,
+ BAT_ROAM_ADV = 0x08
};
/* this file is included by batctl which needs these defines */
--
1.7.10
10 years
[B.A.T.M.A.N.] [PATCHv2] batman-adv: beautify tt_global_add() argument list
by Antonio Quartulli
Instead of adding a new bool argument each time it is needed, it is better (and
simpler) to pass an 8bit flag argument which contains all the needed flags
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
changes in v2:
- rebased on top of the last patches for code restyling
routing.c | 4 ++--
translation-table.c | 24 +++++++++---------------
translation-table.h | 4 ++--
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/routing.c b/routing.c
index c3160be..1260253 100644
--- a/routing.c
+++ b/routing.c
@@ -697,8 +697,8 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
roam_adv_packet->src, roam_adv_packet->client);
batadv_tt_global_add(bat_priv, orig_node, roam_adv_packet->client,
- atomic_read(&orig_node->last_ttvn) + 1, true,
- false);
+ TT_CLIENT_ROAM,
+ atomic_read(&orig_node->last_ttvn) + 1);
/* Roaming phase starts: I have new information but the ttvn has not
* been incremented yet. This flag will make me check all the incoming
diff --git a/translation-table.c b/translation-table.c
index 2c8266a..c03c479 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -656,8 +656,8 @@ batadv_tt_global_add_orig_entry(struct tt_global_entry *tt_global_entry,
/* caller must hold orig_node refcount */
int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_addr, uint8_t ttvn,
- bool roaming, bool wifi)
+ const unsigned char *tt_addr, uint8_t flags,
+ uint8_t ttvn)
{
struct tt_global_entry *tt_global_entry = NULL;
int ret = 0;
@@ -667,15 +667,14 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr);
if (!tt_global_entry) {
- tt_global_entry = kzalloc(sizeof(*tt_global_entry),
- GFP_ATOMIC);
+ tt_global_entry = kzalloc(sizeof(*tt_global_entry), GFP_ATOMIC);
if (!tt_global_entry)
goto out;
common = &tt_global_entry->common;
memcpy(common->addr, tt_addr, ETH_ALEN);
- common->flags = NO_FLAGS;
+ common->flags = flags;
tt_global_entry->roam_at = 0;
atomic_set(&common->refcount, 2);
@@ -717,9 +716,6 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
orig_node, ttvn);
}
- if (wifi)
- tt_global_entry->common.flags |= TT_CLIENT_WIFI;
-
batadv_dbg(DBG_TT, bat_priv,
"Creating new global tt entry: %pM (via %pM)\n",
tt_global_entry->common.addr, orig_node->orig);
@@ -727,7 +723,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
out_remove:
/* remove address from local hash if present */
batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
- "global tt received", roaming);
+ "global tt received", flags & TT_CLIENT_ROAM);
ret = 1;
out:
if (tt_global_entry)
@@ -1755,7 +1751,6 @@ static void _batadv_tt_update_changes(struct bat_priv *bat_priv,
uint16_t tt_num_changes, uint8_t ttvn)
{
int i;
- int is_wifi;
int roams;
for (i = 0; i < tt_num_changes; i++) {
@@ -1763,13 +1758,12 @@ static void _batadv_tt_update_changes(struct bat_priv *bat_priv,
roams = (tt_change + i)->flags & TT_CLIENT_ROAM;
batadv_tt_global_del(bat_priv, orig_node,
(tt_change + i)->addr,
- "tt removed by changes",
- roams);
+ "tt removed by changes",
+ roams);
} else {
- is_wifi = (tt_change + i)->flags & TT_CLIENT_WIFI;
if (!batadv_tt_global_add(bat_priv, orig_node,
- (tt_change + i)->addr, ttvn,
- false, is_wifi))
+ (tt_change + i)->addr,
+ (tt_change + i)->flags, ttvn))
/* In case of problem while storing a
* global_entry, we stop the updating
* procedure without committing the
diff --git a/translation-table.h b/translation-table.h
index 7edc9df..46b60bd 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -32,8 +32,8 @@ void batadv_tt_global_add_orig(struct bat_priv *bat_priv,
struct orig_node *orig_node,
const unsigned char *tt_buff, int tt_buff_len);
int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *addr, uint8_t ttvn, bool roaming,
- bool wifi);
+ const unsigned char *addr, uint8_t flags,
+ uint8_t ttvn);
int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
struct orig_node *orig_node,
--
1.7.9.4
10 years
[B.A.T.M.A.N.] Can't create new originator
by puyou.lu
Hi.
I saw strange batman logs while testing a batman-adv mesh. Batman-adv module was continuously generating the same logs including a " Creating new originator: b0:c6:9b:80:01:43". But b0:c6:9b:80:01:43 never appears in the output of 'batctl o':
admin@HND-Mesh:~# batctl o
[B.A.T.M.A.N. adv 2012.0.0, MainIF/MAC: wlan0/b0:c6:9b:80:01:5b (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ...
b0:c6:9b:80:01:5c 0.010s (255) b0:c6:9b:80:01:5c [ wlan0]: b0:c6:9b:80:01:5f (209) b0:c6:9b:80:01:6b (231) b0:c6:9b:80:01:6b (227) b0:c6:9b:80:01:5c (255) b0:c6:9b:80:01:5c ( 0)
b0:c6:9b:80:01:45 3.830s (223) b0:c6:9b:80:01:5f [ wlan0]: b0:c6:9b:80:01:5c (209) b0:c6:9b:80:01:6b ( 0) b0:c6:9b:80:01:6b ( 0) b0:c6:9b:80:01:5f (223)
b0:c6:9b:80:01:6b 4.520s (255) b0:c6:9b:80:01:6b [ wlan0]: b0:c6:9b:80:01:5f (206) b0:c6:9b:80:01:5c (245) b0:c6:9b:80:01:6b (255) b0:c6:9b:80:01:6b (251)
b0:c6:9b:80:01:3b 1.570s (237) b0:c6:9b:80:01:5f [ wlan0]: b0:c6:9b:80:01:5c (226) b0:c6:9b:80:01:6b ( 0) b0:c6:9b:80:01:6b ( 0) b0:c6:9b:80:01:5f (237)
b0:c6:9b:80:01:5f 3.520s (255) b0:c6:9b:80:01:5f [ wlan0]: b0:c6:9b:80:01:6b (231) b0:c6:9b:80:01:6b (227) b0:c6:9b:80:01:5c (244) b0:c6:9b:80:01:5f (255)
Now I can nerver reach b0:c6:9b:80:01:43. Anyone tell me why this happens?
And, what does "Drop packet: packet within seqno protection time" mean? What is the "seqno protection time"?
Any help will be appreciated and thanks in advance.
Here is part of the looply generated logs:
[ 969] Creating new originator: b0:c6:9b:80:01:43
[ 969] old packet received, start protection
[ 969] Drop packet: OGM via unknown neighbor!
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:57, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:43, via prev OG: b0:c6:9b:80:01:59, seqno 109828, ttvn 6, crc 5961, changes 0, td 229, TTL 48, V 14, IDF 0)
[ 969] Drop packet: packet within seqno protection time (sender: b0:c6:9b:80:01:57)
[ 969] Sending own packet (originator b0:c6:9b:80:01:56, seqno 1251, TTL 2) on interface wlan1 [b0:c6:9b:80:01:56]
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:56, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:56, via prev OG: b0:c6:9b:80:01:56, seqno 1251, ttvn 2, crc 51283, changes 0, td 255, TTL 2, V 14, IDF 0)
[ 969] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:56)
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:56, via prev OG: b0:c6:9b:80:01:56, seqno 1251, ttvn 2, crc 51283, changes 0, td 233, TTL 1, V 14, IDF 1)
[ 969] Drop packet: originator packet from myself (via neighbor)
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:56, via prev OG: b0:c6:9b:80:01:56, seqno 1251, ttvn 2, crc 51283, changes 0, td 233, TTL 1, V 14, IDF 1)
[ 969] Drop packet: originator packet from myself (via neighbor)
[ 969] Sending own packet (originator b0:c6:9b:80:01:5b, seqno 1251, TQ 255, TTL 50, IDF off, ttvn 2) on interface wlan0 [b0:c6:9b:80:01:5b]
[ 969] Sending own packet (originator b0:c6:9b:80:01:5b, seqno 1251, TQ 255, TTL 50, IDF off, ttvn 2) on interface wlan1 [b0:c6:9b:80:01:56]
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:5b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 969] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:5b)
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:56, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 969] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:56)
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 2, V 14, IDF 0)
[ 969] updating last_seqno: old 1245, new 1246
[ 969] bidirectional: orig = b0:c6:9b:80:01:5d neigh = b0:c6:9b:80:01:5d => own_bcast = 0, real recv = 62, local tq: 0, asym_penalty: 255, total tq: 0
[ 969] Forwarding packet: tq_orig: 0, tq_avg: 0, tq_forw: 0, ttl_orig: 1, ttl_forw: 1
[ 969] Forwarding packet: rebroadcast neighbor packet with direct link flag
[ 969] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 2, V 14, IDF 0)
[ 969] bidirectional: orig = b0:c6:9b:80:01:5d neigh = b0:c6:9b:80:01:5d => own_bcast = 0, real recv = 64, local tq: 0, asym_penalty: 255, total tq: 0
[ 969] Forwarding packet: tq_orig: 0, tq_avg: 0, tq_forw: 0, ttl_orig: 1, ttl_forw: 1
[ 969] Forwarding packet: rebroadcast neighbor packet with direct link flag
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 1)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 1, V 14, IDF 1)
[ 970] Drop packet: originator packet with tq equal 0
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 1)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 1, V 14, IDF 1)
[ 970] Drop packet: originator packet with tq equal 0
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5f, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 237, TTL 49, V 14, IDF 1)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5f, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 1, V 14, IDF 1)
[ 970] Drop packet: originator packet with tq equal 0
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5c, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 1)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5c, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 1)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5d, seqno 1246, TTL 1) on interface wlan1 [b0:c6:9b:80:01:56]
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 0)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5b, via prev OG: b0:c6:9b:80:01:5b, seqno 1251, ttvn 2, crc 51283, changes 0, td 245, TTL 49, V 14, IDF 0)
[ 970] Drop packet: originator packet from myself (via neighbor)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:56, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 1, V 14, IDF 1)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:56)
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5d, seqno 1246, TTL 1) on interface wlan0 [b0:c6:9b:80:01:5b]
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5d, via prev OG: b0:c6:9b:80:01:5d, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 1, V 14, IDF 1)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:5b)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5c, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 970] updating last_seqno: old 1245, new 1246
[ 970] bidirectional: orig = b0:c6:9b:80:01:5c neigh = b0:c6:9b:80:01:5c => own_bcast = 0, real recv = 63, local tq: 0, asym_penalty: 255, total tq: 0
[ 970] Forwarding packet: tq_orig: 0, tq_avg: 251, tq_forw: 0, ttl_orig: 49, ttl_forw: 49
[ 970] Forwarding packet: rebroadcast neighbor packet with direct link flag
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 970] Drop packet: OGM via unknown neighbor!
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5c, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 970] bidirectional: orig = b0:c6:9b:80:01:5c neigh = b0:c6:9b:80:01:5c => own_bcast = 63, real recv = 64, local tq: 251, asym_penalty: 255, total tq: 251
[ 970] update_originator(): Searching and updating originator entry of received packet
[ 970] Updating existing last-hop neighbor of originator
[ 970] Forwarding packet: tq_orig: 251, tq_avg: 251, tq_forw: 241, ttl_orig: 49, ttl_forw: 49
[ 970] Forwarding packet: rebroadcast neighbor packet with direct link flag
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5d, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 255, TTL 50, V 14, IDF 0)
[ 970] Drop packet: OGM via unknown neighbor!
[ 970] Originator timeout: originator b0:c6:9b:80:01:43, last_valid 0
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 233, TTL 49, V 14, IDF 1)
[ 970] bidirectional: orig = b0:c6:9b:80:01:5c neigh = b0:c6:9b:80:01:6b => own_bcast = 64, real recv = 64, local tq: 255, asym_penalty: 255, total tq: 233
[ 970] update_originator(): Searching and updating originator entry of received packet
[ 970] Updating existing last-hop neighbor of originator
[ 970] Drop packet: duplicate packet received
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6b, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 233, TTL 49, V 14, IDF 1)
[ 970] bidirectional: orig = b0:c6:9b:80:01:5c neigh = b0:c6:9b:80:01:6b => own_bcast = 63, real recv = 64, local tq: 251, asym_penalty: 255, total tq: 229
[ 970] update_originator(): Searching and updating originator entry of received packet
[ 970] Updating existing last-hop neighbor of originator
[ 970] Drop packet: duplicate packet received
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5c, seqno 1246, TQ 0, TTL 49, IDF off, ttvn 2) on interface wlan0 [b0:c6:9b:80:01:5b]
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5c, seqno 1246, TQ 0, TTL 49, IDF on, ttvn 2) on interface wlan1 [b0:c6:9b:80:01:56]
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 49, V 14, IDF 0)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:5b)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:56, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 0, TTL 49, V 14, IDF 1)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:56)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5f, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 228, TTL 49, V 14, IDF 1)
[ 970] bidirectional: orig = b0:c6:9b:80:01:5c neigh = b0:c6:9b:80:01:5f => own_bcast = 64, real recv = 64, local tq: 255, asym_penalty: 255, total tq: 228
[ 970] update_originator(): Searching and updating originator entry of received packet
[ 970] Updating existing last-hop neighbor of originator
[ 970] Drop packet: duplicate packet received
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5c, seqno 1246, TQ 241, TTL 49, IDF on, ttvn 2) on interface wlan0 [b0:c6:9b:80:01:5b]
[ 970] Forwarding packet (originator b0:c6:9b:80:01:5c, seqno 1246, TQ 241, TTL 49, IDF off, ttvn 2) on interface wlan1 [b0:c6:9b:80:01:56]
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:5b, IF: wlan1 [b0:c6:9b:80:01:56] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 241, TTL 49, V 14, IDF 1)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:5b)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:56, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:5c, via prev OG: b0:c6:9b:80:01:5c, seqno 1246, ttvn 2, crc 38681, changes 0, td 241, TTL 49, V 14, IDF 0)
[ 970] Drop packet: received my own broadcast (sender: b0:c6:9b:80:01:56)
[ 970] Received BATMAN packet via NB: b0:c6:9b:80:01:6c, IF: wlan0 [b0:c6:9b:80:01:5b] (from OG: b0:c6:9b:80:01:43, via prev OG: b0:c6:9b:80:01:43, seqno 109829, ttvn 6, crc 5961, changes 0, td 245, TTL 49, V 14, IDF 1)
[ 970] Creating new originator: b0:c6:9b:80:01:43
[ 970] old packet received, start protection
[ 970] Drop packet: OGM via unknown neighbor!
10 years
[B.A.T.M.A.N.] [PATCHv3] batman-adv: clear ADD+DEL (and viceversa) events in the same orig-interval
by Antonio Quartulli
During an OGM-interval (time between two different OGM sendings) the same client
could roam away and then roam back to us. In this case the node would add two
events to the events list (that is going to be sent appended to the next OGM). A
DEL one and an ADD one. Obviously they will only increase the overhead (either in
the air and on the receiver side) and eventually trigger wrong states/events
without producing any real effect.
For this reason we can safely delete any ADD event with its related DEL one.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
changes in v3:
- rebased on top of the last patches for code restyling
translation-table.c | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index cb1d3a8..2c8266a 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -156,7 +156,9 @@ batadv_tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry)
static void batadv_tt_local_event(struct bat_priv *bat_priv,
const uint8_t *addr, uint8_t flags)
{
- struct tt_change_node *tt_change_node;
+ struct tt_change_node *tt_change_node, *entry, *safe;
+ bool event_removed = false;
+ bool del_op_requested, del_op_entry;
tt_change_node = kmalloc(sizeof(*tt_change_node), GFP_ATOMIC);
@@ -166,13 +168,45 @@ static void batadv_tt_local_event(struct bat_priv *bat_priv,
tt_change_node->change.flags = flags;
memcpy(tt_change_node->change.addr, addr, ETH_ALEN);
+ del_op_requested = flags & TT_CLIENT_DEL;
+
+ /* check for ADD+DEL or DEL+ADD events */
spin_lock_bh(&bat_priv->tt_changes_list_lock);
+ list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list,
+ list) {
+ if (!batadv_compare_eth(entry->change.addr, addr))
+ continue;
+
+ /* DEL+ADD in the same orig interval have no effect and can be
+ * removed to avoid silly behaviour on the receiver side. The
+ * other way around (ADD+DEL) can happen in case of roaming of
+ * a client still in the NEW state. Roaming of NEW clients is
+ * now possible due to automatically recognition of "temporary"
+ * clients
+ */
+ del_op_entry = entry->change.flags & TT_CLIENT_DEL;
+ if (!del_op_requested && del_op_entry)
+ goto del;
+ if (del_op_requested && !del_op_entry)
+ goto del;
+ continue;
+del:
+ list_del(&entry->list);
+ kfree(entry);
+ event_removed = true;
+ goto unlock;
+ }
+
/* track the change in the OGMinterval list */
list_add_tail(&tt_change_node->list, &bat_priv->tt_changes_list);
- atomic_inc(&bat_priv->tt_local_changes);
+
+unlock:
spin_unlock_bh(&bat_priv->tt_changes_list_lock);
- atomic_set(&bat_priv->tt_ogm_append_cnt, 0);
+ if (event_removed)
+ atomic_dec(&bat_priv->tt_local_changes);
+ else
+ atomic_inc(&bat_priv->tt_local_changes);
}
int batadv_tt_len(int changes_num)
--
1.7.9.4
10 years
Re: [B.A.T.M.A.N.] hotplug.d
by Marek Lindner
On Thursday, May 31, 2012 21:21:19 you wrote:
> i'm sorry but in the makefile of openwrt package the mantainer is
> marek linder......
>
> ???
Guess that due to copy & paste. Maybe you simply send a patch to the openwrt-
devel list ?
Marek
10 years, 1 month
[B.A.T.M.A.N.] Questions regarding the Emulation envirnment setup
by NorthPole
Hello everyone, i'm trying to setup an emulation environment and i
have some questions:
* although i downloaded the vde2-2.3.1 source and the appropriate
patches (vde2-2.3.1_colour.patch and
vde2-2.3.1-wirefilter-ethertype.patch ) the wirefilter patch could not
be applied giving the following output
$patch <vde2-2.3.1-wirefilter-ethertype.patch
patching file wirefilter.c
Hunk #1 FAILED at 59.
Hunk #2 FAILED at 524.
Hunk #3 FAILED at 1391.
Hunk #4 FAILED at 1402.
Hunk #5 FAILED at 1421.
Hunk #6 FAILED at 1475.
6 out of 6 hunks FAILED -- saving rejects to file wirefilter.c.rej
any tips on how I can find why it failed and how to apply the patch?
*I ran the script without the wirefilter patch and I got a blank
terminal,is this expected?
* how can I get the dmesg(and generally any command) output
from the qemu instances?
*provided i have built open-wrt with batman and have put the
appropriate script in wrt's ./files/etc/rc.local batman should start
as a daemon right?
given that, I should be seeing batman packets in the capture, right?
*wireshark should recognize that a given packet is an ogm packet or
there is another way to filter only the relevant ones?
Thank you for your time
10 years, 1 month
[B.A.T.M.A.N.] hotplug.d
by Filippo Sallemi
Hi all,
there is an error in /etc/hotplug.d/net/99-batman-adv at line 9.
The function that be called is bat_config and not config_bat
Could someone fix it in latest batman-adv stable release?
Rgds
--
Filippo Sallemi
10 years, 1 month