Project

General

Profile

Actions

Bug #433

closed

Failure handling in batadv_iv_ogm_aggregate_new breaks OGM transmission

Added by Sven Eckelmann 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
05/15/2026
Due date:
% Done:

0%

Estimated time:

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]").

Actions #1

Updated by Sven Eckelmann 5 months ago

  • Description updated (diff)
Actions #2

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;
Actions #3

Updated by Sven Eckelmann 5 months ago

  • Description updated (diff)
Actions #5

Updated by Sven Eckelmann 5 months ago

  • Status changed from New to Resolved
  • Target version set to 2026.2
Actions #6

Updated by Sven Eckelmann 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF