summaryrefslogtreecommitdiffstats
path: root/net/mesh11sd/patches/100-do-not-run-get_current_setup-until-after-version-argument.patch
blob: 6fb80fdb7ede1967b4d5af04c87eae6a5ee235d8 (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
47
48
49
50
51
From 443cdb4c9f0ca20466f6ae31a81047bfeb95825c Mon Sep 17 00:00:00 2001
From: Rob White <rob@blue-wave.net>
Date: Thu, 6 Aug 2026 21:57:14 +0000
Subject: [PATCH] Fix - do not run get_current_setup until after version
 argument

get_current_setup() runs before any argument is parsed, so mesh11sd -v
and mesh11sd -h collect the whole runtime environment first. That
includes refresh_bridgemac(), which calls wait_for_interface() for
br-lan; when that interface is not up, the poll loop runs for the full
interface_timeout, ten seconds by default.

On a running router br-lan is up, the loop exits on its first iteration
and the delay is invisible. It shows up wherever the interface is absent
or still coming up, such as the OpenWrt package CI, which probes every
installed executable for its version with a ten second timeout.

Handle the informational options first and exit, then run the setup for
the options that need it.

Upstream-Status: Backport [https://github.com/openNDS/mesh11sd/commit/443cdb4c9f0ca20466f6ae31a81047bfeb95825c]
---
--- a/src/mesh11sd
+++ b/src/mesh11sd
@@ -5976,8 +5976,6 @@ else
 	mesh11sdpid=$(pgrep -f "/bin/sh /usr/sbin/mesh11sd")
 fi
 
-get_current_setup 2> /dev/null
-
 if [ -z "$1" ] || [ "$1" = "-h" ] || [ $1 = "--help" ] || [ $1 = "help" ]; then
 	echo "
   Usage: mesh11sd [option] [argument...]]
@@ -6153,11 +6151,16 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ $
   For further documentation, see: https://github.com/openNDS/mesh11sd#readme
 
 "
+	exit 0
 
 elif [ "$1" = "-v" ] || [ $1 = "--version" ] || [ $1 = "version" ]; then
 	echo "mesh11sd version $version"
+	exit 0
+fi
+
+get_current_setup 2> /dev/null
 
-elif [ "$1" = "debuglevel" ]; then
+if [ "$1" = "debuglevel" ]; then
 
 	if [ -z "$2" ];then
 		echo "$debuglevel"