Bug #433
closedFailure handling in batadv_iv_ogm_aggregate_new breaks OGM transmission
0%
Description
If there is an error in batadv_iv_ogm_aggregate_new happens, it never reaches
INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
batadv_iv_send_outstanding_bat_ogm_packet);
batadv_forw_packet_ogmv1_queue(bat_priv, forw_packet_aggr, send_time);
And this is the only way how the OGM scheduler can rearm itself. The (own) OGM sending will therefore stop and can never recover itself. If this happens on all devices in the mesh, they will be silent after a while.
The problematic code was implemented in commit 485fc9e88c38 ("re-implement packet scheduler by using a timer per packet") but can only be triggered after the alloc checks in commit d893c5d00f63 ("[batman-adv] Cleanup aggregation.[ch]").
Updated by Sven Eckelmann 5 months ago
Just a random hack to test it:
diff --git i/net/batman-adv/bat_iv_ogm.c w/net/batman-adv/bat_iv_ogm.c
index 74ef7dc2..ec5ba70f 100644
--- i/net/batman-adv/bat_iv_ogm.c
+++ w/net/batman-adv/bat_iv_ogm.c
@@ -557,6 +557,13 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
else
skb_size = packet_len;
+ if_incoming->bat_iv.b++;
+ if_incoming->bat_iv.b %= 10;
+ if (if_incoming->bat_iv.b == 0) {
+ printk("reject OGM\n");
+ return;
+ }
+
skb_size += ETH_HLEN;
skb = netdev_alloc_skb_ip_align(NULL, skb_size);
diff --git i/net/batman-adv/types.h w/net/batman-adv/types.h
index c8c3e806..3fba1aaa 100644
--- i/net/batman-adv/types.h
+++ w/net/batman-adv/types.h
@@ -80,6 +80,8 @@ struct batadv_hard_iface_bat_iv {
/** @ogm_buff_len: length of the OGM packet buffer */
int ogm_buff_len;
+ unsigned int b;
+
/** @ogm_seqno: OGM sequence number - used to identify each OGM */
atomic_t ogm_seqno;
It basically does the same what also the rest of the code would do when it has an error batadv_iv_ogm_aggregate_new. See for example just a lines below:
skb = netdev_alloc_skb_ip_align(NULL, skb_size);
if (!skb)
return;
Updated by Sven Eckelmann 5 months ago
I've tried to create a PoC how to handle this specific problem: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20260515-bat_iv-own-fwd-failure-recover-v1-1-caa171e7d59e@narfation.org/
Updated by Sven Eckelmann 5 months ago
- Status changed from New to Resolved
- Target version set to 2026.2