[B.A.T.M.A.N.] batman-adv and/or batmand porting effort to FreeBSD
by Mahdi Mokhtari
Hi,
After some time of playing with the B.A.T.M.A.N protocol and
net-interface on OpenWRT and Debian I was thinking to use it with
the servers I use everyday (and maybe on routers/appliances I have
nanoBSD on).
So I started an effort...
(As a background) I already ported some applications to FreeBSD [and I'm
maintaining them] and
also I did work already on the Linux emulation layer of FreeBSD (FreeBSD
has a Linux syscall-emulation and Linux-KPI layers).
So my approach (as naturally I didn't expect the build of batman-adv.ko
to be successful as is),
was based on the approach that we [at FreeBSD] did to port Linux's
drm... <https://github.com/FreeBSDDesktop/kms-drm>
I ended up in adding some header-files to FreeBSD Linux-KPI (like
average.h, percpu.h, ...).
Now I'm at a state that Netlink blocks me and I'm to determine next step :-)
[Which I don't assume it being trivial with my current approach]
So I'd like to ask:
1- Is it better approach to "rewrite" batman-adv.ko [at least
Netlink-ish (let's call "Linuxism") parts] than what I'm doing now?
2- Any other efforts are being done out there?
3- is batmand deprecated [So I should mainly focus on batman-adv.ko]?
4- any other comments do you have? :D
P.S. sorry if I'm not really good at starting conversation from scratch
and out-of-nowhere :D
but I hope by continuing the collaboration we can have better (more
enriched) FreeBSD and better (as in more portable) B.A.T.M.A.N :-)
--
Best regards, MMokhi.
3 years, 1 month
[B.A.T.M.A.N.] [PATCH v5 0/7] B.A.T.M.A.N. V - fallback to tp meter estimation if throughput otherwise not available
by Marek Lindner
Under normal circumstances B.A.T.M.A.N. V retrieves the neighbor
throughput values to populate its metric tables from the various
drivers such as WiFi throughput tables and Ethernet throughput..
Whenever the interface drivers do not export link throughput
information manual overrides become necessary. To further
automate and thus better support these setups, ELP may call the
batman-adv throughput meter to schedule a throughput estimation
to be used to populate the metric table.
v5:
* fix tp_vars refcount on queue_work() failure
* squash batadv_tp_start_work() into batadv_tp_start()
v4:
* read tp measurement result only once
v3:
* fix ELP tp meter result computation
* use batadv_has_timed_out() instead of custom implementation
* set ELP tp meter test duration to 1000ms in patch #6
* add comment explaining periodic scheduling
v2:
* added sysfs attribute to configure tp meter test duration
* fixed null pointer dereference in TP meter packet sending routine
* fixed storing the measured throughput in the correct variable
* checkpatch/kerneldoc/sparse/smatch cleanup
Antonio Quartulli (3):
batman-adv: tp_meter - prevent concurrent tp_meter sessions by using
workqueue
batman-adv: tp_meter - don't check for existing session
batman-adv: tp_meter - add option to perform one-hop test
Marek Lindner (4):
batman-adv: tp_meter - allow up to 10 queued sessions
batman-adv: tp_meter - add caller distinction
batman-adv: ELP - use tp meter to estimate the throughput if otherwise
not available
batman-adv: ELP - add throughput meter test duration attribute
.../ABI/testing/sysfs-class-net-batman-adv | 7 +
include/uapi/linux/batadv_packet.h | 2 +
net/batman-adv/bat_v.c | 1 +
net/batman-adv/bat_v_elp.c | 69 ++-
net/batman-adv/bat_v_elp.h | 21 +
net/batman-adv/main.c | 10 +-
net/batman-adv/main.h | 7 +-
net/batman-adv/netlink.c | 3 +-
net/batman-adv/routing.c | 6 +-
net/batman-adv/sysfs.c | 3 +
net/batman-adv/tp_meter.c | 484 +++++++++++-------
net/batman-adv/tp_meter.h | 11 +-
net/batman-adv/types.h | 36 ++
13 files changed, 453 insertions(+), 207 deletions(-)
--
2.18.0
3 years, 2 months
[B.A.T.M.A.N.] [PATCH] batman-adv: handle race condition for claims also in batadv_bla_rx
by Simon Wunderlich
From: Andreas Pape <apape(a)phoenixcontact.com>
Like in the case of the patch for batadv_bla_tx to handle a race
condition when claiming a mac address for bla, a similar situation
can occur when claiming is triggered via batadv_bla_rx. This patch
solves this with a similar approach as for batadv_bla_tx.
Signed-off-by: Andreas Pape <apape(a)phoenixcontact.com>
---
net/batman-adv/bridge_loop_avoidance.c | 31 ++++++++++++++++++++-----------
net/batman-adv/translation-table.c | 26 ++++++++++++++++++++++++++
net/batman-adv/translation-table.h | 3 +++
3 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index d07e89e..cab8980 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1847,19 +1847,28 @@ bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
if (!claim) {
/* possible optimization: race for a claim */
- /* No claim exists yet, claim it for us!
+ /* Make sure this packet is not looping back
+ * from our own backbone.
*/
- batadv_dbg(BATADV_DBG_BLA, bat_priv,
- "bla_rx(): Unclaimed MAC %pM found. Claim it. Local: %s\n",
- ethhdr->h_source,
- batadv_is_my_client(bat_priv,
- ethhdr->h_source, vid) ?
- "yes" : "no");
- batadv_handle_claim(bat_priv, primary_if,
- primary_if->net_dev->dev_addr,
- ethhdr->h_source, vid);
- goto allow;
+ if (batadv_tt_local_has_timed_out(bat_priv, ethhdr->h_source,
+ vid, 100)) {
+ /* No claim exists yet, claim it for us!
+ */
+ batadv_dbg(BATADV_DBG_BLA, bat_priv,
+ "bla_rx(): Unclaimed MAC %pM found. Claim it. Local: %s\n",
+ ethhdr->h_source,
+ batadv_is_my_client(bat_priv,
+ ethhdr->h_source, vid) ?
+ "yes" : "no");
+
+ batadv_handle_claim(bat_priv, primary_if,
+ primary_if->net_dev->dev_addr,
+ ethhdr->h_source, vid);
+ goto allow;
+ } else {
+ goto handled;
+ }
}
/* if it is our own claim ... */
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index e75b493..b908195 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -4380,3 +4380,29 @@ void batadv_tt_cache_destroy(void)
kmem_cache_destroy(batadv_tt_req_cache);
kmem_cache_destroy(batadv_tt_roam_cache);
}
+
+bool batadv_tt_local_has_timed_out(struct batadv_priv *bat_priv,
+ const u8 *addr, unsigned short vid,
+ unsigned int timeout)
+{
+ struct batadv_tt_local_entry *tt_local_entry;
+ bool ret = true;
+
+ tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
+ if (!tt_local_entry)
+ goto out;
+ /* Check if the client has been logically deleted (but is kept for
+ * consistency purpose)
+ */
+ if ((tt_local_entry->common.flags & BATADV_TT_CLIENT_PENDING) ||
+ (tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM))
+ goto out;
+ /* Check that the tt_local_entry has a certain age */
+ if (!batadv_has_timed_out(tt_local_entry->last_seen, timeout))
+ ret = false;
+
+out:
+ if (tt_local_entry)
+ batadv_tt_local_entry_put(tt_local_entry);
+ return ret;
+}
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 411d586..b05d0d8 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -65,5 +65,8 @@ bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv,
int batadv_tt_cache_init(void);
void batadv_tt_cache_destroy(void);
+bool batadv_tt_local_has_timed_out(struct batadv_priv *bat_priv,
+ const u8 *addr, unsigned short vid,
+ unsigned int timeout);
#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
--
1.7.0.4
3 years, 7 months
[B.A.T.M.A.N.] [RFC maint v2] batman-adv: fix adding VLANs with partial state
by Marek Lindner
Whenever a new VLAN is created on top of batman virtual interfaces
the batman-adv kernel module creates internal structures to track
the status of said VLAN. Amongst other things, the MAC address of
the VLAN interface itself has to be stored.
Without this change a VLAN and its infrastructure could be created
while the interface MAC address is not stored without triggering
any error, thus creating issues in other parts of the code.
Prevent the VLAN from being created if the MAC address can not
be stored.
Fixes: 952cebb57518 ("batman-adv: add per VLAN interface attribute framework")
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
---
net/batman-adv/hard-interface.c | 2 +-
net/batman-adv/soft-interface.c | 105 ++++++++++++++++++++++++--------
net/batman-adv/soft-interface.h | 3 +-
3 files changed, 83 insertions(+), 27 deletions(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index c405d15b..0b22cc4d 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -1000,7 +1000,7 @@ static int batadv_hard_if_event(struct notifier_block *this,
if (batadv_softif_is_valid(net_dev) && event == NETDEV_REGISTER) {
batadv_sysfs_add_meshif(net_dev);
bat_priv = netdev_priv(net_dev);
- batadv_softif_create_vlan(bat_priv, BATADV_NO_FLAGS);
+ batadv_softif_create_vlan_late(bat_priv, BATADV_NO_FLAGS);
return NOTIFY_DONE;
}
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index edeffcb9..728d9d40 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -563,16 +563,36 @@ struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv,
}
/**
- * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
+ * batadv_softif_destroy_vlan() - remove and destroy a softif_vlan object
+ * @bat_priv: the bat priv with all the soft interface information
+ * @vlan: the object to remove
+ */
+static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv,
+ struct batadv_softif_vlan *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_put(vlan);
+}
+
+/**
+ * batadv_softif_create_vlan_early() - allocate the needed resources for a new
+ * vlan, defer sysfs creation till later
* @bat_priv: the bat priv with all the soft interface information
* @vid: the VLAN identifier
*
* Return: 0 on success, a negative error otherwise.
*/
-int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
+static int batadv_softif_create_vlan_early(struct batadv_priv *bat_priv,
+ unsigned short vid)
{
struct batadv_softif_vlan *vlan;
- int err;
+ bool client_added;
vlan = batadv_softif_vlan_get(bat_priv, vid);
if (vlan) {
@@ -590,12 +610,6 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
atomic_set(&vlan->ap_isolation, 0);
- err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan);
- if (err) {
- kfree(vlan);
- return err;
- }
-
spin_lock_bh(&bat_priv->softif_vlan_list_lock);
kref_get(&vlan->refcount);
hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
@@ -604,32 +618,63 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
/* add a new TT local entry. This one will be marked with the NOPURGE
* flag
*/
- batadv_tt_local_add(bat_priv->soft_iface,
- bat_priv->soft_iface->dev_addr, vid,
- BATADV_NULL_IFINDEX, BATADV_NO_MARK);
+ client_added = batadv_tt_local_add(bat_priv->soft_iface,
+ bat_priv->soft_iface->dev_addr, vid,
+ BATADV_NULL_IFINDEX, BATADV_NO_MARK);
/* don't return reference to new softif_vlan */
batadv_softif_vlan_put(vlan);
+ if (!client_added) {
+ batadv_softif_destroy_vlan(bat_priv, vlan);
+ return -ENOENT;
+ }
+
return 0;
}
/**
- * batadv_softif_destroy_vlan() - remove and destroy a softif_vlan object
+ * batadv_softif_create_vlan_late() - complete softif vlan creation with the
+ * sysfs entries
* @bat_priv: the bat priv with all the soft interface information
- * @vlan: the object to remove
+ * @vid: the VLAN identifier
+ *
+ * Return: 0 on success, a negative error otherwise.
*/
-static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv,
- struct batadv_softif_vlan *vlan)
+int batadv_softif_create_vlan_late(struct batadv_priv *bat_priv,
+ unsigned short vid)
{
- /* 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);
+ struct batadv_softif_vlan *vlan;
+ int ret;
+
+ vlan = batadv_softif_vlan_get(bat_priv, vid);
+ if (!vlan)
+ return -ENOENT;
+
+ ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan);
- batadv_sysfs_del_vlan(bat_priv, vlan);
batadv_softif_vlan_put(vlan);
+ return ret;
+}
+
+/**
+ * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
+ * @bat_priv: the bat priv with all the soft interface information
+ * @vid: the VLAN identifier
+ *
+ * Return: 0 on success, a negative error otherwise.
+ */
+static int batadv_softif_create_vlan(struct batadv_priv *bat_priv,
+ unsigned short vid)
+{
+ int err;
+
+ err = batadv_softif_create_vlan_early(bat_priv, vid);
+ if (err)
+ return err;
+
+ err = batadv_softif_create_vlan_late(bat_priv, vid);
+ return err;
}
/**
@@ -648,6 +693,7 @@ static int batadv_interface_add_vid(struct net_device *dev, __be16 proto,
{
struct batadv_priv *bat_priv = netdev_priv(dev);
struct batadv_softif_vlan *vlan;
+ bool client_added;
int ret;
/* only 802.1Q vlans are supported.
@@ -683,9 +729,14 @@ static int batadv_interface_add_vid(struct net_device *dev, __be16 proto,
* flag. This must be added again, even if the vlan object already
* exists, because the entry was deleted by kill_vid()
*/
- batadv_tt_local_add(bat_priv->soft_iface,
- bat_priv->soft_iface->dev_addr, vid,
- BATADV_NULL_IFINDEX, BATADV_NO_MARK);
+ client_added = batadv_tt_local_add(bat_priv->soft_iface,
+ bat_priv->soft_iface->dev_addr, vid,
+ BATADV_NULL_IFINDEX, BATADV_NO_MARK);
+
+ if (!client_added) {
+ batadv_softif_destroy_vlan(bat_priv, vlan);
+ return -ENOENT;
+ }
return 0;
}
@@ -850,6 +901,10 @@ static int batadv_softif_init_late(struct net_device *dev)
if (ret < 0)
goto unreg_debugfs;
+ ret = batadv_softif_create_vlan_early(bat_priv, BATADV_NO_FLAGS);
+ if (ret < 0)
+ goto unreg_debugfs;
+
return 0;
unreg_debugfs:
diff --git a/net/batman-adv/soft-interface.h b/net/batman-adv/soft-interface.h
index daf87f07..b8a9a3c8 100644
--- a/net/batman-adv/soft-interface.h
+++ b/net/batman-adv/soft-interface.h
@@ -36,7 +36,8 @@ struct net_device *batadv_softif_create(struct net *net, const char *name);
void batadv_softif_destroy_sysfs(struct net_device *soft_iface);
bool batadv_softif_is_valid(const struct net_device *net_dev);
extern struct rtnl_link_ops batadv_link_ops;
-int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid);
+int batadv_softif_create_vlan_late(struct batadv_priv *bat_priv,
+ unsigned short vid);
void batadv_softif_vlan_put(struct batadv_softif_vlan *softif_vlan);
struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv,
unsigned short vid);
--
2.17.0
3 years, 7 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Increase purge timeout on DAT DHT candidates
by Linus Lüssing
Currently, the DHT_GET messages of the DAT will likely be left
unanswered due to the following issues:
When a node has a matching DAT Cache entry for a local ARP Request then
this node will answer it directly with the information provided by the
cache. This however, will likely lead to missing ARP Replies from the
original host. Which in turn leads to the DAT cache not being updated.
Then the local DAT cache entry will time out, triggering a unicasted
DHT_GET. However, as the 5min. timeout has passed, the DAT DHT
candidates will likely have purged their entry, too.
So basically this results in an ARP Request broadcast fallback every
five minutes.
A second issue is that it is quite common that a host which has long
gone offline will be tried to be contacted by another one at some remote
period larger than the current 5min. timeout. This too leads to flooded
ARP Requests.
With this patch the purge timeout for local DAT cache entries and
entries submitted via a DHT_PUT message is differentiated:
While the former stays at 5min. the latter is increased to 30min. Which
decreases the rate of broadcasted ARP Requests.
Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue>
---
Some old investigations and analysis seemed to indicate a potential
reduction of 91.71% of unanswered ARP Requests (45min: 97.95%, 60min:
98.95%):
https://www.open-mesh.org/projects/batman-adv/wiki/DAT_DHCP_Snooping
This patch is rebased on top of:
"batman-adv: DHCP snooping for DAT"
And it is a follow-up of:
"batman-adv: Increase DHCP snooped DAT entry purge timeout in DHT"
- https://patchwork.open-mesh.org/patch/17364/
---
net/batman-adv/distributed-arp-table.c | 39 ++++++++++++++++++++++------------
net/batman-adv/distributed-arp-table.h | 3 ++-
net/batman-adv/main.h | 2 ++
net/batman-adv/routing.c | 8 ++++---
net/batman-adv/types.h | 5 +++++
5 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 899ab051..34898abf 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -152,7 +152,9 @@ static void batadv_dat_entry_put(struct batadv_dat_entry *dat_entry)
static bool batadv_dat_to_purge(struct batadv_dat_entry *dat_entry)
{
return batadv_has_timed_out(dat_entry->last_update,
- BATADV_DAT_ENTRY_TIMEOUT);
+ BATADV_DAT_ENTRY_TIMEOUT) &&
+ batadv_has_timed_out(dat_entry->last_dht_update,
+ BATADV_DAT_DHT_TIMEOUT);
}
/**
@@ -369,9 +371,11 @@ batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip,
* @ip: ipv4 to add/edit
* @mac_addr: mac address to assign to the given ipv4
* @vid: VLAN identifier
+ * @extended_timeout: whether this should be cached with an extended timeout
*/
-static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip,
- u8 *mac_addr, unsigned short vid)
+static void
+batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip, u8 *mac_addr,
+ unsigned short vid, bool extended_timeout)
{
struct batadv_dat_entry *dat_entry;
int hash_added;
@@ -382,6 +386,10 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip,
if (!batadv_compare_eth(dat_entry->mac_addr, mac_addr))
ether_addr_copy(dat_entry->mac_addr, mac_addr);
dat_entry->last_update = jiffies;
+
+ if (extended_timeout)
+ dat_entry->last_dht_update = jiffies;
+
batadv_dbg(BATADV_DBG_DAT, bat_priv,
"Entry updated: %pI4 %pM (vid: %d)\n",
&dat_entry->ip, dat_entry->mac_addr,
@@ -397,6 +405,7 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip,
dat_entry->vid = vid;
ether_addr_copy(dat_entry->mac_addr, mac_addr);
dat_entry->last_update = jiffies;
+ dat_entry->last_dht_update = extended_timeout ? jiffies : 0;
kref_init(&dat_entry->refcount);
kref_get(&dat_entry->refcount);
@@ -1229,7 +1238,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
hw_src = batadv_arp_hw_src(skb, hdr_size);
ip_dst = batadv_arp_ip_dst(skb, hdr_size);
- batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
+ batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid, false);
dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, vid);
if (dat_entry) {
@@ -1322,7 +1331,7 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
batadv_dbg_arp(bat_priv, skb, hdr_size, "Parsing incoming ARP REQUEST");
- batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
+ batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid, false);
dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, vid);
if (!dat_entry)
@@ -1386,8 +1395,8 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
hw_dst = batadv_arp_hw_dst(skb, hdr_size);
ip_dst = batadv_arp_ip_dst(skb, hdr_size);
- batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
- batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
+ batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid, false);
+ batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid, false);
/* Send the ARP reply to the candidates for both the IP addresses that
* the node obtained from the ARP reply
@@ -1402,12 +1411,14 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
* @bat_priv: the bat priv with all the soft interface information
* @skb: packet to check
* @hdr_size: size of the encapsulation header
+ * @is_dht_put: whether this is a BATADV_P_DAT_DHT_PUT message
*
* Return: true if the packet was snooped and consumed by DAT. False if the
* packet has to be delivered to the interface
*/
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
- struct sk_buff *skb, int hdr_size)
+ struct sk_buff *skb, int hdr_size,
+ bool is_dht_put)
{
struct batadv_dat_entry *dat_entry = NULL;
u16 type;
@@ -1450,8 +1461,8 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
/* Update our internal cache with both the IP addresses the node got
* within the ARP reply
*/
- batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
- batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
+ batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid, is_dht_put);
+ batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid, is_dht_put);
/* If BLA is enabled, only forward ARP replies if we have claimed the
* source of the ARP reply or if no one else of the same backbone has
@@ -1705,8 +1716,8 @@ static void batadv_dat_put_dhcp(struct batadv_priv *bat_priv, u8 *chaddr,
skb_set_network_header(skb, ETH_HLEN);
- batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid);
- batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
+ batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid, false);
+ batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid, false);
batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT);
batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
@@ -1827,8 +1838,8 @@ void batadv_dat_snoop_incoming_dhcp_ack(struct batadv_priv *bat_priv,
hw_src = ethhdr->h_source;
vid = batadv_dat_get_vid(skb, &hdr_size);
- batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid);
- batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
+ batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid, false);
+ batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid, false);
batadv_dbg(BATADV_DBG_DAT, bat_priv,
"Snooped from incoming DHCPACK (server address): %pI4, %pM (vid: %i)\n",
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index 68c0ff32..21dbf285 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -45,7 +45,8 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
struct sk_buff *skb);
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
- struct sk_buff *skb, int hdr_size);
+ struct sk_buff *skb, int hdr_size,
+ bool is_dht_put);
void batadv_dat_snoop_outgoing_dhcp_ack(struct batadv_priv *bat_priv,
struct sk_buff *skb,
__be16 proto,
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 05cb9080..6c1488f8 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -51,6 +51,8 @@
#define BATADV_ORIG_WORK_PERIOD 1000 /* 1 second */
#define BATADV_MCAST_WORK_PERIOD 500 /* 0.5 seconds */
#define BATADV_DAT_ENTRY_TIMEOUT (5 * 60000) /* 5 mins in milliseconds */
+#define BATADV_DAT_DHT_TIMEOUT (30 * 60000) /* 30 mins in milliseconds */
+
/* sliding packet range of received originator messages in sequence numbers
* (should be a multiple of our word size)
*/
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index cae0e5dd..2b5d50ab 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -974,7 +974,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
int check, hdr_size = sizeof(*unicast_packet);
enum batadv_subtype subtype;
int ret = NET_RX_DROP;
- bool is4addr, is_gw;
+ bool is4addr, is_gw, is_dht_put = false;
unicast_packet = (struct batadv_unicast_packet *)skb->data;
is4addr = unicast_packet->packet_type == BATADV_UNICAST_4ADDR;
@@ -1033,6 +1033,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
orig_addr = unicast_4addr_packet->src;
orig_node = batadv_orig_hash_find(bat_priv,
orig_addr);
+ } else if (subtype == BATADV_P_DAT_DHT_PUT) {
+ is_dht_put = true;
}
}
@@ -1040,7 +1042,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
hdr_size))
goto rx_success;
if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb,
- hdr_size))
+ hdr_size, is_dht_put))
goto rx_success;
batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size);
@@ -1277,7 +1279,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size))
goto rx_success;
- if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size))
+ if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size, false))
goto rx_success;
batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index a21b34ed..74801d79 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -2280,6 +2280,11 @@ struct batadv_dat_entry {
*/
unsigned long last_update;
+ /**
+ * @last_dht_update: time in jiffies when a DHT_PUT was last received
+ */
+ unsigned long last_dht_update;
+
/** @hash_entry: hlist node for &batadv_priv_dat.hash */
struct hlist_node hash_entry;
--
2.11.0
3 years, 10 months
[B.A.T.M.A.N.] WARNING in batadv_mcast_mla_tt_retract
by syzbot
Hello,
syzbot found the following crash on:
HEAD commit: eed9688f8513 Merge branch 'ras-core-for-linus' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=103bffaf400000
kernel config: https://syzkaller.appspot.com/x/.config?x=fa5c63e12fd85b25
dashboard link: https://syzkaller.appspot.com/bug?extid=83f2d54ec6b7e417e13f
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+83f2d54ec6b7e417e13f(a)syzkaller.appspotmail.com
bond0 (unregistering): Releasing backup interface bond_slave_0
bond0 (unregistering): Released all slaves
WARNING: CPU: 1 PID: 7 at net/batman-adv/multicast.c:337
batadv_mcast_mla_tt_retract+0x476/0x590 net/batman-adv/multicast.c:337
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 7 Comm: kworker/u4:0 Not tainted 4.20.0+ #169
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: bat_events batadv_mcast_mla_update
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d3/0x2c6 lib/dump_stack.c:113
panic+0x2ad/0x55c kernel/panic.c:188
__warn.cold.8+0x20/0x45 kernel/panic.c:540
report_bug+0x254/0x2d0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
do_invalid_op+0x36/0x40 arch/x86/kernel/traps.c:290
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
RIP: 0010:batadv_mcast_mla_tt_retract+0x476/0x590
net/batman-adv/multicast.c:337
Code: 00 00 ad de 4c 89 ff 49 89 47 08 e8 b4 0f 03 fa e9 b6 fe ff ff 49 8d
47 10 48 89 85 60 ff ff ff e9 05 ff ff ff e8 4a 30 c0 f9 <0f> 0b e9 3f fc
ff ff e8 6e 3b 03 fa e9 44 fe ff ff 4c 89 f7 e8 81
RSP: 0018:ffff8880a9e1f260 EFLAGS: 00010293
RAX: ffff8880a9e041c0 RBX: 0000000000000001 RCX: ffffffff87bedca3
RDX: 0000000000000000 RSI: ffffffff87bee066 RDI: 0000000000000007
RBP: ffff8880a9e1f328 R08: ffff8880a9e041c0 R09: ffffed1015ce5b8f
R10: 0000000000000003 R11: ffff8880ae72dc7b R12: ffff8880a9e1f490
R13: 0000000000000000 R14: ffff888055b95fc0 R15: ffff8880a9e1f710
__batadv_mcast_mla_update net/batman-adv/multicast.c:635 [inline]
batadv_mcast_mla_update+0x819/0x2da0 net/batman-adv/multicast.c:661
process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153
worker_thread+0x17f/0x1390 kernel/workqueue.c:2296
kthread+0x35a/0x440 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Kernel Offset: disabled
Rebooting in 86400 seconds..
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller(a)googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
3 years, 10 months
[B.A.T.M.A.N.] [PATCH v4] batman-adv: Add multicast-to-unicast support for multiple targets
by Linus Lüssing
With this patch multicast packets with a limited number of destinations
(current default: 16) will be split and transmitted by the originator as
individual unicast transmissions.
Wifi broadcasts with their low bitrate are still a costly undertaking.
In a mesh network this cost multiplies with the overall size of the mesh
network. Therefore using multiple unicast transmissions instead of
broadcast flooding is almost always less burdensome for the mesh
network.
The maximum amount of unicast packets can be configured via the newly
introduced multicast_fanout parameter. If this limit is exceeded
distribution will fall back to classic broadcast flooding.
The multicast-to-unicast conversion is performed on the initial
multicast sender node and counts on a final destination node, mesh-wide
basis (and not next hop, neighbor node basis).
Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue>
---
Changelog v4:
* Fixed return value in "batadv_mcast_forw_tt_send()" for an empty
TT entry: the want-all lists still need to be tried. This fixes
potential packetloss.
Changelog v3:
* removed sysfs support for multicast_fanout
Changelog v2:
* rebased to master (no conflicts/changes)
* fixed a double free bug in the batman-adv multicast-to-multi-unicast
patch: led to crashes, especially on netifd restart/shutdown
-> https://github.com/freifunk-gluon/gluon/issues/1468
* fixed skb memory leaks in error cases
* added netlink support for multicast_fanout
* updated multicast_fanout sysfs ABI doc date to Feb 2019
---
include/uapi/linux/batman_adv.h | 7 ++
net/batman-adv/multicast.c | 242 ++++++++++++++++++++++++++++++++++++-
net/batman-adv/multicast.h | 18 +++
net/batman-adv/netlink.c | 11 ++
net/batman-adv/soft-interface.c | 8 +-
net/batman-adv/translation-table.c | 6 +-
net/batman-adv/translation-table.h | 4 +
net/batman-adv/types.h | 6 +
8 files changed, 296 insertions(+), 6 deletions(-)
diff --git a/include/uapi/linux/batman_adv.h b/include/uapi/linux/batman_adv.h
index 305bf316..e875e0c5 100644
--- a/include/uapi/linux/batman_adv.h
+++ b/include/uapi/linux/batman_adv.h
@@ -491,6 +491,13 @@ enum batadv_nl_attrs {
*/
BATADV_ATTR_THROUGHPUT_OVERRIDE,
+ /**
+ * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet
+ * copies that may be generated for a multicast-to-unicast conversion.
+ * Once this limit is exceeded distribution will fall back to broadcast.
+ */
+ BATADV_ATTR_MULTICAST_FANOUT,
+
/* add attributes above here, update the policy in netlink.c */
/**
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index f91b1b62..9a9bec22 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -66,6 +66,7 @@
#include "hash.h"
#include "log.h"
#include "netlink.h"
+#include "send.h"
#include "soft-interface.h"
#include "translation-table.h"
#include "tvlv.h"
@@ -992,6 +993,7 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
int ret, tt_count, ip_count, unsnoop_count, total_count;
bool is_unsnoopable = false;
struct ethhdr *ethhdr;
+ unsigned int mcast_fanout;
ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable);
if (ret == -ENOMEM)
@@ -1025,8 +1027,246 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
case 0:
return BATADV_FORW_NONE;
default:
- return BATADV_FORW_ALL;
+ mcast_fanout = atomic_read(&bat_priv->multicast_fanout);
+
+ if (!unsnoop_count && total_count <= mcast_fanout)
+ return BATADV_FORW_SOME;
}
+
+ return BATADV_FORW_ALL;
+}
+
+/**
+ * batadv_mcast_forw_tt_send() - send a packet to multicast listeners
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: the multicast packet to transmit
+ * @vid: the vlan identifier
+ * @limit: number of remaining, maximum transmissions
+ *
+ * Sends copies of a frame with multicast destination to any multicast
+ * listener registered in the translation table. A transmission is performed
+ * via a batman-adv unicast packet for each such destination node.
+ *
+ * Return: NET_XMIT_DROP if limit was reached or on memory allocation failure,
+ * NET_XMIT_SUCCESS otherwise.
+ */
+static int
+batadv_mcast_forw_tt_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid, unsigned int *limit)
+{
+ unsigned int limit_tmp = *limit;
+ int ret = NET_XMIT_SUCCESS;
+ struct sk_buff *newskb;
+
+ struct batadv_tt_orig_list_entry *orig_entry;
+
+ struct batadv_tt_global_entry *tt_global;
+ const u8 *addr = eth_hdr(skb)->h_dest;
+
+ tt_global = batadv_tt_global_hash_find(bat_priv, addr, vid);
+ if (!tt_global)
+ goto out;
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu(orig_entry, &tt_global->orig_list, list) {
+ if (!limit_tmp) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ newskb = skb_copy(skb, GFP_ATOMIC);
+ if (!newskb) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
+ orig_entry->orig_node, vid);
+ limit_tmp--;
+ }
+ rcu_read_unlock();
+
+ batadv_tt_global_entry_put(tt_global);
+ *limit = limit_tmp;
+
+out:
+ return ret;
+}
+
+/**
+ * batadv_mcast_forw_want_all_ipv4_send() - send to nodes with want-all-ipv4
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: the multicast packet to transmit
+ * @vid: the vlan identifier
+ * @limit: number of remaining, maximum transmissions
+ *
+ * Sends copies of a frame with multicast destination to any node with a
+ * BATADV_MCAST_WANT_ALL_IPV4 flag set. A transmission is performed via a
+ * batman-adv unicast packet for each such destination node.
+ *
+ * Return: NET_XMIT_DROP if limit was reached or on memory allocation failure,
+ * NET_XMIT_SUCCESS otherwise.
+ */
+static int
+batadv_mcast_forw_want_all_ipv4_send(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, unsigned short vid,
+ unsigned int *limit)
+{
+ struct batadv_orig_node *orig_node;
+ unsigned int limit_tmp = *limit;
+ int ret = NET_XMIT_SUCCESS;
+ struct sk_buff *newskb;
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu(orig_node,
+ &bat_priv->mcast.want_all_ipv4_list,
+ mcast_want_all_ipv4_node) {
+ if (!limit_tmp) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ newskb = skb_copy(skb, GFP_ATOMIC);
+ if (!newskb) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
+ orig_node, vid);
+ limit_tmp--;
+ }
+ rcu_read_unlock();
+
+ *limit = limit_tmp;
+ return ret;
+}
+
+/**
+ * batadv_mcast_forw_want_all_ipv6_send() - send to nodes with want-all-ipv6
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: The multicast packet to transmit
+ * @vid: the vlan identifier
+ * @limit: number of remaining, maximum transmissions
+ *
+ * Sends copies of a frame with multicast destination to any node with a
+ * BATADV_MCAST_WANT_ALL_IPV6 flag set. A transmission is performed via a
+ * batman-adv unicast packet for each such destination node.
+ *
+ * Return: NET_XMIT_DROP if limit was reached or on memory allocation failure,
+ * NET_XMIT_SUCCESS otherwise.
+ */
+static int
+batadv_mcast_forw_want_all_ipv6_send(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, unsigned short vid,
+ unsigned int *limit)
+{
+ struct batadv_orig_node *orig_node;
+ unsigned int limit_tmp = *limit;
+ int ret = NET_XMIT_SUCCESS;
+ struct sk_buff *newskb;
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu(orig_node,
+ &bat_priv->mcast.want_all_ipv6_list,
+ mcast_want_all_ipv6_node) {
+ if (!limit_tmp) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ newskb = skb_copy(skb, GFP_ATOMIC);
+ if (!newskb) {
+ ret = NET_XMIT_DROP;
+ break;
+ }
+
+ batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
+ orig_node, vid);
+ limit_tmp--;
+ }
+ rcu_read_unlock();
+
+ *limit = limit_tmp;
+ return ret;
+}
+
+/**
+ * batadv_mcast_forw_want_all_send() - send packet to nodes in a want-all list
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: the multicast packet to transmit
+ * @vid: the vlan identifier
+ * @limit: number of remaining, maximum transmissions
+ *
+ * Sends copies of a frame with multicast destination to any node with a
+ * BATADV_MCAST_WANT_ALL_IPV4 or BATADV_MCAST_WANT_ALL_IPV6 flag set. A
+ * transmission is performed via a batman-adv unicast packet for each such
+ * destination node.
+ *
+ * Return: NET_XMIT_DROP if limit was reached, on memory allocation failure
+ * or if the protocol family is neither IPv4 nor IPv6. NET_XMIT_SUCCESS
+ * otherwise.
+ */
+static int
+batadv_mcast_forw_want_all_send(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, unsigned short vid,
+ unsigned int *limit)
+{
+ switch (ntohs(eth_hdr(skb)->h_proto)) {
+ case ETH_P_IP:
+ return batadv_mcast_forw_want_all_ipv4_send(bat_priv, skb, vid,
+ limit);
+ case ETH_P_IPV6:
+ return batadv_mcast_forw_want_all_ipv6_send(bat_priv, skb, vid,
+ limit);
+ default:
+ /* we shouldn't be here... */
+ return NET_XMIT_DROP;
+ }
+}
+
+/**
+ * batadv_mcast_forw_send() - send packet to any detected multicast recpient
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: the multicast packet to transmit
+ * @vid: the vlan identifier
+ * @limit: number of remaining, maximum transmissions
+ *
+ * Sends copies of a frame with multicast destination to any node that signaled
+ * interest in it, that is either via the translation table or the according
+ * want-all flags. A transmission is performed via a batman-adv unicast packet
+ * for each such destination node.
+ *
+ * The given skb is consumed/freed.
+ *
+ * Return: NET_XMIT_DROP if limit was reached, on memory allocation failure
+ * or if the protocol family is neither IPv4 nor IPv6. NET_XMIT_SUCCESS
+ * otherwise.
+ */
+int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid)
+{
+ /* The previous forw mode check will try to limit to the configured
+ * fanout. Here, we allow a little bit of flexibility in case some
+ * new listeners might have joined between these function calls.
+ */
+ unsigned int limit = 2 * atomic_read(&bat_priv->multicast_fanout);
+ int ret;
+
+ ret = batadv_mcast_forw_tt_send(bat_priv, skb, vid, &limit);
+ if (ret != NET_XMIT_SUCCESS) {
+ kfree_skb(skb);
+ return ret;
+ }
+
+ ret = batadv_mcast_forw_want_all_send(bat_priv, skb, vid, &limit);
+ if (ret != NET_XMIT_SUCCESS) {
+ kfree_skb(skb);
+ return ret;
+ }
+
+ consume_skb(skb);
+ return ret;
}
/**
diff --git a/net/batman-adv/multicast.h b/net/batman-adv/multicast.h
index 466013fe..83c5ff51 100644
--- a/net/batman-adv/multicast.h
+++ b/net/batman-adv/multicast.h
@@ -36,6 +36,13 @@ enum batadv_forw_mode {
BATADV_FORW_ALL,
/**
+ * @BATADV_FORW_SOME: forward the packet to some nodes (currently via
+ * a multicast-to-unicast conversion and the BATMAN unicast routing
+ * protocol)
+ */
+ BATADV_FORW_SOME,
+
+ /**
* @BATADV_FORW_SINGLE: forward the packet to a single node (currently
* via the BATMAN unicast routing protocol)
*/
@@ -51,6 +58,9 @@ enum batadv_forw_mode
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
struct batadv_orig_node **mcast_single_orig);
+int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid);
+
void batadv_mcast_init(struct batadv_priv *bat_priv);
int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset);
@@ -73,6 +83,14 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
return BATADV_FORW_ALL;
}
+static inline int
+batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid)
+{
+ kfree_skb(skb);
+ return NET_XMIT_DROP;
+}
+
static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
{
return 0;
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 67a58da2..f0458727 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -157,6 +157,7 @@ static const struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
[BATADV_ATTR_HOP_PENALTY] = { .type = NLA_U8 },
[BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 },
[BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 },
+ [BATADV_ATTR_MULTICAST_FANOUT] = { .type = NLA_U32 },
[BATADV_ATTR_NETWORK_CODING_ENABLED] = { .type = NLA_U8 },
[BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 },
[BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 },
@@ -353,6 +354,10 @@ static int batadv_netlink_mesh_fill(struct sk_buff *msg,
if (nla_put_u8(msg, BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED,
!atomic_read(&bat_priv->multicast_mode)))
goto nla_put_failure;
+
+ if (nla_put_u32(msg, BATADV_ATTR_MULTICAST_FANOUT,
+ atomic_read(&bat_priv->multicast_fanout)))
+ goto nla_put_failure;
#endif /* CONFIG_BATMAN_ADV_MCAST */
#ifdef CONFIG_BATMAN_ADV_NC
@@ -592,6 +597,12 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info)
atomic_set(&bat_priv->multicast_mode, !nla_get_u8(attr));
}
+
+ if (info->attrs[BATADV_ATTR_MULTICAST_FANOUT]) {
+ attr = info->attrs[BATADV_ATTR_MULTICAST_FANOUT];
+
+ atomic_set(&bat_priv->multicast_fanout, nla_get_u32(attr));
+ }
#endif /* CONFIG_BATMAN_ADV_MCAST */
#ifdef CONFIG_BATMAN_ADV_NC
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 2e367230..db8ac4df 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -209,7 +209,7 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
unsigned short vid;
u32 seqno;
int gw_mode;
- enum batadv_forw_mode forw_mode;
+ enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE;
struct batadv_orig_node *mcast_single_orig = NULL;
int network_offset = ETH_HLEN;
__be16 proto;
@@ -317,7 +317,8 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
if (forw_mode == BATADV_FORW_NONE)
goto dropped;
- if (forw_mode == BATADV_FORW_SINGLE)
+ if (forw_mode == BATADV_FORW_SINGLE ||
+ forw_mode == BATADV_FORW_SOME)
do_bcast = false;
}
}
@@ -377,6 +378,8 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
ret = batadv_send_skb_unicast(bat_priv, skb,
BATADV_UNICAST, 0,
mcast_single_orig, vid);
+ } else if (forw_mode == BATADV_FORW_SOME) {
+ ret = batadv_mcast_forw_send(bat_priv, skb, vid);
} else {
if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
skb))
@@ -818,6 +821,7 @@ static int batadv_softif_init_late(struct net_device *dev)
bat_priv->mcast.querier_ipv6.shadowing = false;
bat_priv->mcast.flags = BATADV_NO_FLAGS;
atomic_set(&bat_priv->multicast_mode, 1);
+ atomic_set(&bat_priv->multicast_fanout, 16);
atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0);
atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0);
atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0);
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index f73d7913..8f83554b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -61,6 +61,7 @@
#include "log.h"
#include "netlink.h"
#include "originator.h"
+#include "send.h"
#include "soft-interface.h"
#include "tvlv.h"
@@ -205,7 +206,7 @@ batadv_tt_local_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
* Return: a pointer to the corresponding tt_global_entry struct if the client
* is found, NULL otherwise.
*/
-static struct batadv_tt_global_entry *
+struct batadv_tt_global_entry *
batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
unsigned short vid)
{
@@ -300,8 +301,7 @@ static void batadv_tt_global_entry_release(struct kref *ref)
* possibly release it
* @tt_global_entry: tt_global_entry to be free'd
*/
-static void
-batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry)
+void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry)
{
kref_put(&tt_global_entry->common.refcount,
batadv_tt_global_entry_release);
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 61bca75e..5b41f217 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -41,6 +41,10 @@ int batadv_tt_global_dump(struct sk_buff *msg, struct netlink_callback *cb);
void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
s32 match_vid, const char *message);
+struct batadv_tt_global_entry *
+batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
+ unsigned short vid);
+void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry);
int batadv_tt_global_hash_count(struct batadv_priv *bat_priv,
const u8 *addr, unsigned short vid);
struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index a21b34ed..d22cf01e 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1565,6 +1565,12 @@ struct batadv_priv {
* node's sender/originating side
*/
atomic_t multicast_mode;
+
+ /**
+ * @multicast_fanout: Maximum number of packet copies to generate for a
+ * multicast-to-unicast conversion
+ */
+ atomic_t multicast_fanout;
#endif
/** @orig_interval: OGM broadcast interval in milliseconds */
--
2.11.0
3 years, 10 months
[B.A.T.M.A.N.] [PATCH] batman-adv: allow updating DAT entry timeouts on incoming ARP Replies
by Linus Lüssing
Currently incoming ARP Replies, for example via a DHT-PUT message, do
not update the timeout for an already existing DAT entry. These ARP
Replies are dropped instead.
This however defeats the purpose of the DHCPACK snooping, for instance.
Right now, a DAT entry in the DHT will be purged every five minutes,
likely leading to a mesh-wide ARP Request broadcast after this timeout.
Which then recreates the entry. The idea of the DHCPACK snooping is to
be able to update an entry before a timeout happens, to avoid ARP Request
flooding.
This patch fixes this issue by updating a DAT entry on incoming
ARP Replies even if a matching DAT entry already exists. While still
filtering the ARP Reply towards the soft-interface, to avoid duplicate
messages on the client device side.
Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue>
---
This patch was verified in VMs via gratuitous ARP Replies generated by
"mausezahn", together with the
"batman-adv: allow snooping gratuitous ARP Replies" patch.
Before this patch, the timeout observed via "batctl dc" would continue
to increase on gratuitous ARP Reply reception. After this patch, the
last-seen value was reset to 0 successfully.
---
net/batman-adv/distributed-arp-table.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 310a4f35..8d290da0 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1444,7 +1444,6 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
hw_src, &ip_src, hw_dst, &ip_dst,
dat_entry->mac_addr, &dat_entry->ip);
dropped = true;
- goto out;
}
/* Update our internal cache with both the IP addresses the node got
@@ -1453,6 +1452,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
+ if (dropped)
+ goto out;
+
/* If BLA is enabled, only forward ARP replies if we have claimed the
* source of the ARP reply or if no one else of the same backbone has
* already claimed that client. This prevents that different gateways
--
2.11.0
3 years, 10 months
[B.A.T.M.A.N.] [RFC openwrt-routing] batman-adv: Split batadv proto in meshif and hardif part
by Sven Eckelmann
batman-adv allows to configure three different objects:
* batadv hardif
- network interface used by batadv meshif to transport the batman-adv
packets
- its master interface is set to the batadv meshif
* batadv (meshif/softif)
- virtual interface that emulates a normal 802.3 interface on top
- encapsulates traffic and forwards it via the batadv hardifs
* batadv vlan
- potential VLAN ID on top of batadv meshif
- allows filtering of traffic from specific VIDs
While batadv vlan objects were already represented as an own proto
"batadv_vlan", the batadv meshif could never be fully configured using
/etc/config/network. Instead, parts of its configuration were stored in
/etc/config/batman_adv and some in the interfaces with the "batadv" proto.
To increase the confusion, the "batadv" proto wasn't used to define the
batadv meshif but to identify batadv (slave) hardifs. The batman-adv
meshifs were also never created directly but only when a hardif was
configured. The actual modification of the configuration settings was then
applied using a hotplug script hack. The batadv meshif network interface
could therefore only be created when an hardif was available and not
manipulated with ifup/ifdown. Also `/etc/init.d/network reload` didn't
modify the batadv meshif interface configuration correctly.
The "batadv" is now renamed to "batadv_hardif" and a new "batadv" proto is
used to configure the main (meshif) network interface with all its
configuration.
A simple network configuration with WiFi & ethernet interfaces and static
IP on top of bat0 would look like:
# batadv meshif bat0
config interface 'bat0'
option proto 'batadv'
option routing_algo 'BATMAN_IV'
option aggregated_ogms 1
option ap_isolation 0
option bonding 0
option fragmentation 1
#option gw_bandwidth '10000/2000'
option gw_mode 'off'
#option gw_sel_class 20
option log_level 0
option orig_interval 1000
option bridge_loop_avoidance 1
option distributed_arp_table 1
option multicast_mode 1
option network_coding 0
option hop_penalty 30
option isolation_mark '0x00000000/0x00000000'
# add *single* wifi-iface with network bat0_hardif_wlan as hardif to bat0
config interface 'bat0_hardif_wlan'
option mtu '1536'
option proto 'batadv_hardif'
option master 'bat0'
# option ifname is filled out by the wifi-iface
# add eth0 as hardif to bat0
config interface 'bat0_hardif_eth0'
option proto 'batadv_hardif'
option master 'bat0'
option ifname 'eth0'
option mtu '1536'
# configure IP on bat0
config interface 'bat0_lan'
option ifname 'bat0'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
Cc: Matthias Schiffer <mschiffer(a)universe-factory.net>
Cc: openwrt-devel(a)lists.openwrt.org
Cc: Gui Iribarren <gui(a)altermundi.net>
Cc: Moritz Warning <moritzwarning(a)web.de>
Changes depend on https://github.com/openwrt-routing/packages/pull/451
---
batman-adv/Makefile | 2 +-
batman-adv/files/etc/config/batman-adv | 20 ----
.../files/etc/hotplug.d/net/99-batman-adv | 12 --
.../etc/uci-defaults/99-migrate-batadv_hardif | 97 +++++++++++++++
batman-adv/files/lib/batman-adv/config.sh | 69 -----------
batman-adv/files/lib/netifd/proto/batadv.sh | 112 +++++++++++++++---
.../files/lib/netifd/proto/batadv_hardif.sh | 40 +++++++
7 files changed, 235 insertions(+), 117 deletions(-)
delete mode 100644 batman-adv/files/etc/config/batman-adv
delete mode 100644 batman-adv/files/etc/hotplug.d/net/99-batman-adv
create mode 100755 batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif
delete mode 100644 batman-adv/files/lib/batman-adv/config.sh
create mode 100755 batman-adv/files/lib/netifd/proto/batadv_hardif.sh
diff --git a/batman-adv/Makefile b/batman-adv/Makefile
index 82af6c7..b250888 100644
--- a/batman-adv/Makefile
+++ b/batman-adv/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv
PKG_VERSION:=2019.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_HASH:=3e97d8a771cdbd7b2df42c52b88e071eaa58b5d28eb4e17a4b13b6698debbdc0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/batman-adv/files/etc/config/batman-adv b/batman-adv/files/etc/config/batman-adv
deleted file mode 100644
index 21138cb..0000000
--- a/batman-adv/files/etc/config/batman-adv
+++ /dev/null
@@ -1,20 +0,0 @@
-
-config 'mesh' 'bat0'
- #option 'aggregated_ogms' 1
- #option 'ap_isolation' 0
- #option 'bonding' 0
- #option 'fragmentation' 1
- #option 'gw_bandwidth' '10000/2000'
- #option 'gw_mode' 'off'
- #option 'gw_sel_class' 20
- #option 'log_level' 0
- #option 'orig_interval' 1000
- #option 'bridge_loop_avoidance' 1
- #option 'distributed_arp_table' 1
- #option 'multicast_mode' 1
- #option 'network_coding' 0
- #option 'hop_penalty' 30
- #option 'isolation_mark' '0x00000000/0x00000000'
-
-# yet another batX instance
-# config 'mesh' 'bat5'
diff --git a/batman-adv/files/etc/hotplug.d/net/99-batman-adv b/batman-adv/files/etc/hotplug.d/net/99-batman-adv
deleted file mode 100644
index f0c391f..0000000
--- a/batman-adv/files/etc/hotplug.d/net/99-batman-adv
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-. /lib/batman-adv/config.sh
-
-bat_load_module
-config_load batman-adv
-
-case "$ACTION" in
- add)
- [ -d /sys/class/net/$INTERFACE/mesh/ ] && bat_config "$INTERFACE"
- ;;
-esac
diff --git a/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif b/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif
new file mode 100755
index 0000000..156a33f
--- /dev/null
+++ b/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# This UCI-Defaults script will split the batadv proto network interfaces
+# in batadv_hardif and batadv proto. The configuration options from
+# /etc/config/batman-adv will be moved to the latter.
+
+. /lib/functions.sh
+
+proto_batadv_to_batadv_hardif() {
+ local section="$1"
+ local proto
+ local mesh
+ local routing_algo
+
+ config_get proto "${section}" proto
+ config_get mesh "${section}" mesh
+ config_get routing_algo "${section}" routing_algo
+
+ if [ -z "$mesh" -o "${proto}" != "batadv" ]; then
+ continue
+ fi
+
+ uci set network."${section}".proto="batadv_hardif"
+ uci rename network."${section}".mesh="master"
+ uci delete network."${section}".routing_algo
+
+ # create new section or adjust existing one
+ uci set network."${mesh}"=interface
+ uci set network."${mesh}".proto=batadv
+ [ -n "${routing_algo}" ] && uci set network."${mesh}".routing_algo="${routing_algo}"
+}
+
+mv_batadv_config_section() {
+ local section="$1"
+ local aggregated_ogms
+ local ap_isolation
+ local bonding
+ local bridge_loop_avoidance
+ local distributed_arp_table
+ local fragmentation
+ local gw_bandwidth
+ local gw_mode
+ local gw_sel_class
+ local hop_penalty
+ local isolation_mark
+ local log_level
+ local multicast_mode
+ local network_coding
+ local orig_interval
+
+ config_get aggregated_ogms "${section}" aggregated_ogms
+ config_get ap_isolation "${section}" ap_isolation
+ config_get bonding "${section}" bonding
+ config_get bridge_loop_avoidance "${section}" bridge_loop_avoidance
+ config_get distributed_arp_table "${section}" distributed_arp_table
+ config_get fragmentation "${section}" fragmentation
+ config_get gw_bandwidth "${section}" gw_bandwidth
+ config_get gw_mode "${section}" gw_mode
+ config_get gw_sel_class "${section}" gw_sel_class
+ config_get hop_penalty "${section}" hop_penalty
+ config_get isolation_mark "${section}" isolation_mark
+ config_get log_level "${section}" log_level
+ config_get multicast_mode "${section}" multicast_mode
+ config_get network_coding "${section}" network_coding
+ config_get orig_interval "${section}" orig_interval
+
+ # update section in case it exists
+ [ -n "${aggregated_ogms}" ] && uci set network."${section}".aggregated_ogms="${aggregated_ogms}"
+ [ -n "${ap_isolation}" ] && uci set network."${section}".ap_isolation="${ap_isolation}"
+ [ -n "${bonding}" ] && uci set network."${section}".bonding="${bonding}"
+ [ -n "${bridge_loop_avoidance}" ] && uci set network."${section}".bridge_loop_avoidance="${bridge_loop_avoidance}"
+ [ -n "${distributed_arp_table}" ] && uci set network."${section}".distributed_arp_table="${distributed_arp_table}"
+ [ -n "${fragmentation}" ] && uci set network."${section}".fragmentation="${fragmentation}"
+ [ -n "${gw_bandwidth}" ] && uci set network."${section}".gw_bandwidth="${gw_bandwidth}"
+ [ -n "${gw_mode}" ] && uci set network."${section}".gw_mode="${gw_mode}"
+ [ -n "${gw_sel_class}" ] && uci set network."${section}".gw_sel_class="${gw_sel_class}"
+ [ -n "${hop_penalty}" ] && uci set network."${section}".hop_penalty="${hop_penalty}"
+ [ -n "${isolation_mark}" ] && uci set network."${section}".isolation_mark="${isolation_mark}"
+ [ -n "${log_level}" ] && uci set network."${section}".log_level="${log_level}"
+ [ -n "${multicast_mode}" ] && uci set network."${section}".multicast_mode="${multicast_mode}"
+ [ -n "${network_coding}" ] && uci set network."${section}".network_coding="${network_coding}"
+ [ -n "${orig_interval}" ] && uci set network."${section}".orig_interval="${orig_interval}"
+}
+
+if [ -f /etc/config/batman-adv ]; then
+ config_load network
+ config_foreach proto_batadv_to_batadv_hardif 'interface'
+ uci commit network
+
+ config_load batman-adv
+ config_foreach mv_batadv_config_section 'mesh'
+ uci commit batman-adv
+
+ rm -f /etc/config/batman-adv
+fi
+
+exit 0
diff --git a/batman-adv/files/lib/batman-adv/config.sh b/batman-adv/files/lib/batman-adv/config.sh
deleted file mode 100644
index 952f93e..0000000
--- a/batman-adv/files/lib/batman-adv/config.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-bat_load_module()
-{
- [ -d "/sys/module/batman_adv/" ] && return
-
- . /lib/functions.sh
- load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv*
-}
-
-bat_config()
-{
- local mesh="$1"
- local aggregated_ogms ap_isolation bonding bridge_loop_avoidance distributed_arp_table fragmentation
- local gw_bandwidth gw_mode gw_sel_class isolation_mark hop_penalty multicast_mode network_coding log_level
- local orig_interval
-
- config_get aggregated_ogms "$mesh" aggregated_ogms
- config_get ap_isolation "$mesh" ap_isolation
- config_get bonding "$mesh" bonding
- config_get bridge_loop_avoidance "$mesh" bridge_loop_avoidance
- config_get distributed_arp_table "$mesh" distributed_arp_table
- config_get fragmentation "$mesh" fragmentation
- config_get gw_bandwidth "$mesh" gw_bandwidth
- config_get gw_mode "$mesh" gw_mode
- config_get gw_sel_class "$mesh" gw_sel_class
- config_get hop_penalty "$mesh" hop_penalty
- config_get isolation_mark "$mesh" isolation_mark
- config_get multicast_mode "$mesh" multicast_mode
- config_get network_coding "$mesh" network_coding
- config_get log_level "$mesh" log_level
- config_get orig_interval "$mesh" orig_interval
-
- [ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv mesh $mesh does not exist - check your interface configuration" && return 1
-
- [ -n "$aggregated_ogms" ] && batctl -m "$mesh" aggregation "$aggregated_ogms"
- [ -n "$ap_isolation" ] && batctl -m "$mesh" ap_isolation "$ap_isolation"
- [ -n "$bonding" ] && batctl -m "$mesh" bonding "$bonding"
- [ -n "$bridge_loop_avoidance" ] && batctl -m "$mesh" bridge_loop_avoidance "$bridge_loop_avoidance" 2>&-
- [ -n "$distributed_arp_table" ] && batctl -m "$mesh" distributed_arp_table "$distributed_arp_table" 2>&-
- [ -n "$fragmentation" ] && batctl -m "$mesh" fragmentation "$fragmentation"
-
- case "$gw_mode" in
- server)
- if [ -n "$gw_bandwidth" ]; then
- batctl -m "$mesh" gw_mode "server" "$gw_bandwidth"
- else
- batctl -m "$mesh" gw_mode "server"
- fi
- ;;
- client)
- if [ -n "$gw_sel_class" ]; then
- batctl -m "$mesh" gw_mode "client" "$gw_sel_class"
- else
- batctl -m "$mesh" gw_mode "client"
- fi
- ;;
- *)
- batctl -m "$mesh" gw_mode "off"
- ;;
- esac
-
- [ -n "$hop_penalty" ] && batctl -m "$mesh" hop_penalty "$hop_penalty"
- [ -n "$isolation_mark" ] && batctl -m "$mesh" isolation_mark "$isolation_mark"
- [ -n "$multicast_mode" ] && batctl -m "$mesh" multicast_mode "$multicast_mode" 2>&-
- [ -n "$network_coding" ] && batctl -m "$mesh" network_coding "$network_coding" 2>&-
- [ -n "$log_level" ] && batctl -m "$mesh" loglevel "$log_level" 2>&-
- [ -n "$orig_interval" ] && batctl -m "$mesh" orig_interval "$orig_interval"
-}
diff --git a/batman-adv/files/lib/netifd/proto/batadv.sh b/batman-adv/files/lib/netifd/proto/batadv.sh
index 2233091..eb8153c 100755
--- a/batman-adv/files/lib/netifd/proto/batadv.sh
+++ b/batman-adv/files/lib/netifd/proto/batadv.sh
@@ -1,37 +1,119 @@
#!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
proto_batadv_init_config() {
- proto_config_add_string "mesh"
- proto_config_add_string "routing_algo"
+ no_device=1
+ available=1
+
+ proto_config_add_boolean 'aggregated_ogms:bool'
+ proto_config_add_boolean 'ap_isolation:bool'
+ proto_config_add_boolean 'bonding:bool'
+ proto_config_add_boolean 'bridge_loop_avoidance:bool'
+ proto_config_add_boolean 'distributed_arp_table:bool'
+ proto_config_add_boolean 'fragmentation:bool'
+ proto_config_add_string 'gw_bandwidth'
+ proto_config_add_string 'gw_mode'
+ proto_config_add_int 'gw_sel_class'
+ proto_config_add_int 'hop_penalty'
+ proto_config_add_string 'isolation_mark'
+ proto_config_add_string 'log_level'
+ proto_config_add_boolean 'multicast_mode:bool'
+ proto_config_add_boolean 'network_coding:bool'
+ proto_config_add_int 'orig_interval'
+ proto_config_add_string 'routing_algo'
}
proto_batadv_setup() {
local config="$1"
- local iface="$2"
+ local iface="$config"
+
+ local aggregated_ogms
+ local ap_isolation
+ local bonding
+ local bridge_loop_avoidance
+ local distributed_arp_table
+ local fragmentation
+ local gw_bandwidth
+ local gw_mode
+ local gw_sel_class
+ local hop_penalty
+ local isolation_mark
+ local log_level
+ local multicast_mode
+ local network_coding
+ local orig_interval
+ local routing_algo
+
+ json_get_vars aggregated_ogms
+ json_get_vars ap_isolation
+ json_get_vars bonding
+ json_get_vars bridge_loop_avoidance
+ json_get_vars distributed_arp_table
+ json_get_vars fragmentation
+ json_get_vars gw_bandwidth
+ json_get_vars gw_mode
+ json_get_vars gw_sel_class
+ json_get_vars hop_penalty
+ json_get_vars isolation_mark
+ json_get_vars log_level
+ json_get_vars multicast_mode
+ json_get_vars network_coding
+ json_get_vars orig_interval
+ json_get_vars routing_algo
- local mesh routing_algo
- json_get_vars mesh routing_algo
+ set_default routing_algo 'BATMAN_IV'
- [ -n "$routing_algo" ] || routing_algo="BATMAN_IV"
batctl routing_algo "$routing_algo"
+ batctl -m "$iface" interface create
+
+ [ -n "$aggregated_ogms" ] && batctl -m "$iface" aggregation "$aggregated_ogms"
+ [ -n "$ap_isolation" ] && batctl -m "$iface" ap_isolation "$ap_isolation"
+ [ -n "$bonding" ] && batctl -m "$iface" bonding "$bonding"
+ [ -n "$bridge_loop_avoidance" ] && batctl -m "$iface" bridge_loop_avoidance "$bridge_loop_avoidance" 2>&-
+ [ -n "$distributed_arp_table" ] && batctl -m "$iface" distributed_arp_table "$distributed_arp_table" 2>&-
+ [ -n "$fragmentation" ] && batctl -m "$iface" fragmentation "$fragmentation"
+
+ case "$gw_mode" in
+ server)
+ if [ -n "$gw_bandwidth" ]; then
+ batctl -m "$iface" gw_mode "server" "$gw_bandwidth"
+ else
+ batctl -m "$iface" gw_mode "server"
+ fi
+ ;;
+ client)
+ if [ -n "$gw_sel_class" ]; then
+ batctl -m "$iface" gw_mode "client" "$gw_sel_class"
+ else
+ batctl -m "$iface" gw_mode "client"
+ fi
+ ;;
+ *)
+ batctl -m "$iface" gw_mode "off"
+ ;;
+ esac
+
+ [ -n "$hop_penalty" ] && batctl -m "$iface" hop_penalty "$hop_penalty"
+ [ -n "$isolation_mark" ] && batctl -m "$iface" isolation_mark "$isolation_mark"
+ [ -n "$multicast_mode" ] && batctl -m "$iface" multicast_mode "$multicast_mode" 2>&-
+ [ -n "$network_coding" ] && batctl -m "$iface" network_coding "$network_coding" 2>&-
+ [ -n "$log_level" ] && batctl -m "$iface" loglevel "$log_level" 2>&-
+ [ -n "$orig_interval" ] && batctl -m "$iface" orig_interval "$orig_interval"
- batctl -m "$mesh" interface add "$iface"
proto_init_update "$iface" 1
proto_send_update "$config"
}
proto_batadv_teardown() {
local config="$1"
- local iface="$2"
-
- local mesh
- json_get_vars mesh
+ local iface="$config"
- batctl -m "$mesh" interface del "$iface" || true
+ batctl -m "$iface" interface destroy
}
add_protocol batadv
diff --git a/batman-adv/files/lib/netifd/proto/batadv_hardif.sh b/batman-adv/files/lib/netifd/proto/batadv_hardif.sh
new file mode 100755
index 0000000..9283d2b
--- /dev/null
+++ b/batman-adv/files/lib/netifd/proto/batadv_hardif.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
+
+proto_batadv_hardif_init_config() {
+ proto_config_add_string "master"
+}
+
+proto_batadv_hardif_setup() {
+ local config="$1"
+ local iface="$2"
+
+ local master
+
+ json_get_vars master
+
+ ( proto_add_host_dependency "$config" '' "$master" )
+
+ batctl -m "$master" interface -M add "$iface"
+
+ proto_init_update "$iface" 1
+ proto_send_update "$config"
+}
+
+proto_batadv_hardif_teardown() {
+ local config="$1"
+ local iface="$2"
+
+ local master
+
+ json_get_vars master
+
+ batctl -m "$master" interface -M del "$iface" || true
+}
+
+add_protocol batadv_hardif
--
2.20.1
3 years, 11 months
[B.A.T.M.A.N.] Fwd: nodes start disappearing after a certain node count
by umut deniz
hi,
this mail would be my first post to the list so for a starter i would like
to thank to the project owners, contributors and the community for the great
work being done and appreciate the effort and time being spent for this piece of
software like it is said software is hard.
the main reason i am writing is as follows;
for about 10 months i have been experimenting with batman on various platforms
my current platform is ti's beagleboneblack wireless board running openwrt
distribution (the required bbbw dtb and wl1835 driver firmware applied) with
batman enabled and configured. with this high level description of the
components i am able to build a mesh network 6 nodes (i.e. bbbw cards) but as
soon as i introduce a 7th card into the network batman mesh becomes unresponsive
as the last seen times start to increase and finally, after 200 seconds all the
nodes drops from the originator and neighbor tables which could be inspected
with < :#batctl o> and < :#batctl n> commands respectively. all the cards are on
the same table and well powered.
i would like to give some details about the
configurations of the cards which are identical except the ip addresses
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path
'platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1/usb1/1-1/1-1:1.0'
option htmode 'HT20'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'wifi'
option mode 'mesh'
option ssid 'my-mesh-network'
option mesh_id '02:12:34:56:78:9A'
config wifi-device 'radio1'
option type 'mac80211'
option channel '3'
option hwmode '11n'
option path
'platform/ocp/47810000.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wl18xx.0.auto'
option htmode 'HT40+'
option disabled '0'
config wifi-iface 'wmesh'
option device 'radio1'
option ifname 'adhoc0'
option network 'bat0_hardif_wlan'
option mode 'mesh'
option ssid 'mesh'
option mesh_fwding '0'
option 'mcast_rate' '18000'
option bssid '02:12:34:56:78:9A'
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# cat /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd99:5d77:fecc::/48'
config interface 'bat0_hardif_wlan'
option ifname 'adhoc0'
option mtu '2304'
option proto 'batadv'
option mesh 'bat0'
option ipaddr '192.168.3.100'
option netmask '255.255.255.0'
option routing_algo 'BATMAN_IV'
option ap_isolation '1'
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# cat /etc/config/batman-adv
config 'mesh' 'bat0'
option 'aggregated_ogms' 1
option 'ap_isolation' 1
#option 'bonding' 0
option 'fragmentation' 1
#option 'gw_bandwidth' '10000/2000'
option 'gw_mode' 'off'
#option 'gw_sel_class' 20
option 'log_level' 15
option 'orig_interval' 1000
option 'bridge_loop_avoidance' 0
option 'distributed_arp_table' 0
option 'multicast_mode' 0
optiion 'network_coding' 0
option 'hop_penalty' 15
#option 'isolation_mark' '0x00000000/0x00000000'
# yet another batX instance
# config 'mesh' 'bat5'
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# ifconfig
adhoc0 Link encap:Ethernet HWaddr 38:D2:69:DC:DE:43
inet6 addr: fe80::3ad2:69ff:fedc:de43/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:2304 Metric:1
RX packets:5924 errors:0 dropped:0 overruns:0 frame:0
TX packets:3707 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:370268 (361.5 KiB) TX bytes:327332 (319.6 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:480 errors:0 dropped:0 overruns:0 frame:0
TX packets:480 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39360 (38.4 KiB) TX bytes:39360 (38.4 KiB)
///////////////////// 6 node setup with 5 direct neighbors /////////////////////
root@OpenWrt:/# batctl o
[B.A.T.M.A.N. adv openwrt-2019.0-0, MainIF/MAC:
adhoc0/38:d2:69:dc:de:43 (bat0/6a:40:89:aa:93:a0 BATMAN_IV)]
Originator last-seen (#/255) Nexthop [outgoingIF]
38:d2:69:e0:c3:0d 0.010s (218) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:c3:0d 0.010s (211) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:c3:0d 0.010s (214) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:c3:0d 0.010s (222) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:c3:0d 0.010s (255) 38:d2:69:e0:c3:0d [ adhoc0]
98:84:e3:f0:a5:38 0.700s (225) 38:d2:69:e0:c3:0d [ adhoc0]
98:84:e3:f0:a5:38 0.700s (221) 38:d2:69:e0:5e:de [ adhoc0]
98:84:e3:f0:a5:38 0.700s (225) 38:d2:69:e0:71:73 [ adhoc0]
98:84:e3:f0:a5:38 0.700s (222) 38:d2:69:e0:8f:87 [ adhoc0]
* 98:84:e3:f0:a5:38 0.700s (247) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:8f:87 0.030s (214) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:8f:87 0.030s (221) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:8f:87 0.030s (217) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:8f:87 0.030s (225) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:8f:87 0.030s (255) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:71:73 0.460s (200) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:71:73 0.460s (197) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:71:73 0.460s (200) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:71:73 0.460s (210) 38:d2:69:e0:8f:87 [ adhoc0]
* 38:d2:69:e0:71:73 0.460s (255) 38:d2:69:e0:71:73 [ adhoc0]
38:d2:69:e0:5e:de 0.180s (225) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:5e:de 0.180s (215) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:5e:de 0.180s (218) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:5e:de 0.180s (225) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:5e:de 0.180s (251) 38:d2:69:e0:5e:de [ adhoc0]
root@OpenWrt:/# batctl n
[B.A.T.M.A.N. adv openwrt-2019.0-0, MainIF/MAC:
adhoc0/38:d2:69:dc:de:43 (bat0/6a:40:89:aa:93:a0 BATMAN_IV)]
IF Neighbor last-seen
adhoc0 38:d2:69:e0:c3:0d 0.160s
adhoc0 38:d2:69:e0:5e:de 0.320s
adhoc0 98:84:e3:f0:a5:38 0.830s
adhoc0 38:d2:69:e0:8f:87 0.030s
adhoc0 38:d2:69:e0:71:73 0.630s
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# iw dev adhoc0 station dump
Station 38:d2:69:e0:71:73 (on adhoc0)
inactive time: 80 ms
rx bytes: 1775733
rx packets: 22623
tx bytes: 539
tx packets: 7
tx retries: 0
tx failed: 0
rx drop misc: 12797
signal: 0 dBm
signal avg: -21 dBm
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 27.343Mbps
mesh llid: 32171
mesh plid: 13983
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 491 seconds
Station 38:d2:69:e0:8f:87 (on adhoc0)
inactive time: 20 ms
rx bytes: 1693321
rx packets: 21651
tx bytes: 329
tx packets: 4
tx retries: 0
tx failed: 0
rx drop misc: 12018
signal: 0 dBm
signal avg: -25 dBm
Toffset: 18446744071111214636 us
tx bitrate: 1.0 MBit/s
expected throughput: 121.93Mbps
mesh llid: 30373
mesh plid: 56485
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 489 seconds
Station 98:84:e3:f0:a5:38 (on adhoc0)
inactive time: 50 ms
rx bytes: 1640523
rx packets: 21040
tx bytes: 716
tx packets: 8
tx retries: 0
tx failed: 0
rx drop misc: 11384
signal: 0 dBm
signal avg: -27 dBm
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 25917
mesh plid: 65422
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 487 seconds
Station 38:d2:69:e0:5e:de (on adhoc0)
inactive time: 70 ms
rx bytes: 1580918
rx packets: 20324
tx bytes: 480
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 10662
signal: 0 dBm
signal avg: -34 dBm
Toffset: 18446744071107370820 us
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 52541
mesh plid: 55210
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 485 seconds
Station 38:d2:69:e0:c3:0d (on adhoc0)
inactive time: 60 ms
rx bytes: 1605955
rx packets: 20603
tx bytes: 480
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 11110
signal: 0 dBm
signal avg: -26 dBm
Toffset: 18446744071104088264 us
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 36132
mesh plid: 36029
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 481 seconds
////////////////////////////////////////////////////////////////////////////////
at this point everything is fine i can level 2 ping each neighbor etc. but when
i boot up the 6th neighbor (i.e. 7th node in the mesh network) last-seen values
start to increase and finally nodes disappear
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# batctl o
[B.A.T.M.A.N. adv openwrt-2019.0-0, MainIF/MAC:
adhoc0/38:d2:69:dc:de:43 (bat0/6a:40:89:aa:93:a0 BATMAN_IV)]
Originator last-seen (#/255) Nexthop [outgoingIF]
38:d2:69:e0:c3:0d 97.200s (225) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:c3:0d 97.200s (222) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:c3:0d 97.200s (214) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:c3:0d 97.200s (225) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:c3:0d 97.200s (251) 38:d2:69:e0:c3:0d [ adhoc0]
98:84:e3:f0:a5:38 100.970s (221) 38:d2:69:e0:c3:0d [ adhoc0]
98:84:e3:f0:a5:38 100.970s (225) 38:d2:69:e0:5e:de [ adhoc0]
98:84:e3:f0:a5:38 100.970s (225) 38:d2:69:e0:71:73 [ adhoc0]
98:84:e3:f0:a5:38 100.970s (214) 38:d2:69:e0:8f:87 [ adhoc0]
* 98:84:e3:f0:a5:38 100.970s (255) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:8f:87 100.170s (221) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:8f:87 100.170s (225) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:8f:87 100.170s (225) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:8f:87 100.170s (225) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:8f:87 100.170s (255) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:71:73 18.750s ( 0) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:71:73 18.750s ( 0) 38:d2:69:e0:5e:de [ adhoc0]
38:d2:69:e0:71:73 18.750s ( 0) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:71:73 18.750s ( 0) 38:d2:69:e0:8f:87 [ adhoc0]
* 38:d2:69:e0:71:73 18.750s ( 12) 38:d2:69:e0:71:73 [ adhoc0]
38:d2:69:e0:5e:de 93.200s (218) 38:d2:69:e0:c3:0d [ adhoc0]
38:d2:69:e0:5e:de 93.200s ( 0) 98:84:e3:f0:a5:38 [ adhoc0]
38:d2:69:e0:5e:de 93.200s ( 0) 38:d2:69:e0:8f:87 [ adhoc0]
38:d2:69:e0:5e:de 93.200s (211) 38:d2:69:e0:71:73 [ adhoc0]
* 38:d2:69:e0:5e:de 93.200s (247) 38:d2:69:e0:5e:de [ adhoc0]
root@OpenWrt:/# batctl n
[B.A.T.M.A.N. adv openwrt-2019.0-0, MainIF/MAC:
adhoc0/38:d2:69:dc:de:43 (bat0/6a:40:89:aa:93:a0 BATMAN_IV)]
IF Neighbor last-seen
adhoc0 38:d2:69:e0:c3:0d 121.780s
adhoc0 38:d2:69:e0:5e:de 117.780s
adhoc0 98:84:e3:f0:a5:38 125.560s
adhoc0 38:d2:69:e0:8f:87 124.750s
adhoc0 38:d2:69:e0:71:73 43.210s
////////////////////////////////////////////////////////////////////////////////
at this point the neighbors are giong to dissapear after 200 sec timeout but
the command < :#iw dev adhoc0 station dump> list all the nodes plink established
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# iw dev adhoc0 station dump
Station 38:d2:69:e0:71:73 (on adhoc0)
inactive time: 90 ms
rx bytes: 3864389
rx packets: 49751
tx bytes: 539
tx packets: 7
tx retries: 0
tx failed: 0
rx drop misc: 26681
signal: 0 dBm
signal avg: -21 dBm
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 27.343Mbps
mesh llid: 32171
mesh plid: 13983
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 1159 seconds
Station 38:d2:69:e0:8f:87 (on adhoc0)
inactive time: 30 ms
rx bytes: 3690399
rx packets: 47696
tx bytes: 329
tx packets: 4
tx retries: 0
tx failed: 0
rx drop misc: 24935
signal: 0 dBm
signal avg: -24 dBm
tx bitrate: 1.0 MBit/s
expected throughput: 3.906Mbps
mesh llid: 30373
mesh plid: 56485
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 1157 seconds
Station 98:84:e3:f0:a5:38 (on adhoc0)
inactive time: 60 ms
rx bytes: 3622627
rx packets: 46907
tx bytes: 716
tx packets: 8
tx retries: 0
tx failed: 0
rx drop misc: 24144
signal: 0 dBm
signal avg: -25 dBm
Toffset: 18446744071109913820 us
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 25917
mesh plid: 65422
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 1155 seconds
Station 38:d2:69:e0:5e:de (on adhoc0)
inactive time: 80 ms
rx bytes: 3489728
rx packets: 45344
tx bytes: 480
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 22514
signal: 0 dBm
signal avg: -31 dBm
Toffset: 18446744071107371412 us
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 52541
mesh plid: 55210
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 1153 seconds
Station 38:d2:69:e0:c3:0d (on adhoc0)
inactive time: 80 ms
rx bytes: 3585647
rx packets: 46475
tx bytes: 480
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 23601
signal: 0 dBm
signal avg: -25 dBm
Toffset: 18446744071104087603 us
tx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 65.0 MBit/s MCS 7
expected throughput: 140.625Mbps
mesh llid: 36132
mesh plid: 36029
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: ACTIVE
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 1149 seconds
Station 38:d2:69:cd:86:96 (on adhoc0)
inactive time: 60 ms
rx bytes: 195354
rx packets: 3004
tx bytes: 270
tx packets: 3
tx retries: 0
tx failed: 0
rx drop misc: 3
signal: 0 dBm
signal avg: -41 dBm
Toffset: 18446744070115910174 us
tx bitrate: 1.0 MBit/s
expected throughput: 70.312Mbps
mesh llid: 25879
mesh plid: 29955
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 161 seconds
////////////////////////////////////////////////////////////////////////////////
and finally
////////////////////////////////////////////////////////////////////////////////
root@OpenWrt:/# batctl o
[B.A.T.M.A.N. adv openwrt-2019.0-0, MainIF/MAC:
adhoc0/38:d2:69:dc:de:43 (bat0/6a:40:89:aa:93:a0 BATMAN_IV)]
Originator last-seen (#/255) Nexthop [outgoingIF]
////////////////////////////////////////////////////////////////////////////////
i researched for a while for the cause with no avail. i would appreciate any
kind of help to point me to the right direction to solve this.
ps: i can provide more detail explanation, configuration and logs i you could
tell me which
thank you in advance.
3 years, 11 months