summaryrefslogtreecommitdiffstats
path: root/net/prplmesh/patches/170-ignore-inactive-wireless-backhaul-links.patch
blob: 255bb72ba18d0ebaa3e77d60f1130409d5240f9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From e362259e3b40c451410ae4d2a100d7750f4a2883 Mon Sep 17 00:00:00 2001
From: Andrei Ovcharenko <a@krot.name>
Date: Wed, 29 Jul 2026 22:35:00 +0300
Subject: [PATCH] agent: ignore inactive wireless backhaul links

The backhaul link list stores credentials for every wireless-capable
radio, including radios that are not currently used for backhaul. Link
metrics reporting treated every entry as an active wireless backhaul
and warned whenever an AP-only radio had no backhaul interface.

Skip those expected inactive entries without a warning. Keep the
warning when the selected active wireless backhaul is missing its
interface, and handle a stale radio entry without dereferencing it.

The whole series is publicly reviewable at
https://gitlab.com/kreout/prpl-mesh-mercusys/-/merge_requests/1; the
upstream GitLab only accepts merge requests from project members, so
the upstream submission itself goes through the prpl Foundation Jira.

Signed-off-by: Andrei Ovcharenko <a@krot.name>
---
 .../slave/tasks/link_metrics_collection_task.cpp     | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/agent/src/beerocks/slave/tasks/link_metrics_collection_task.cpp
+++ b/agent/src/beerocks/slave/tasks/link_metrics_collection_task.cpp
@@ -1724,8 +1724,18 @@ bool LinkMetricsCollectionTask::get_neig
 
     for (const auto &bh_wifi_info : db->backhaul.backhaul_links) {
         auto radio = db->radio(bh_wifi_info.iface_name);
+        if (!radio) {
+            LOG(WARNING) << "Backhaul radio " << bh_wifi_info.iface_name << " not found";
+            continue;
+        }
+
         if (radio->back.iface_name.empty()) {
-            LOG(WARNING) << "Found empty backhaul link name!";
+            // backhaul_links also contains credentials for radios that are not currently
+            // used for wireless backhaul. An empty back interface is expected for them.
+            if (db->backhaul.connection_type == AgentDB::sBackhaul::eConnectionType::Wireless &&
+                db->backhaul.selected_iface_name == bh_wifi_info.iface_name) {
+                LOG(WARNING) << "Found empty backhaul link name!";
+            }
             continue;
         }