[openwrt/openwrt] base-files: introduce a function to generate IAID
LEDE Commits
lede-commits at lists.infradead.org
Thu Jan 15 02:07:44 PST 2026
noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/b5d094635118ba1e9cc89abbbabd7e267bd7af3a
commit b5d094635118ba1e9cc89abbbabd7e267bd7af3a
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Tue Jan 13 18:19:48 2026 +0100
base-files: introduce a function to generate IAID
Add new function "network_generate_iface_iaid()" to generate a stable IAID
from an interface name.
(cherry picked from commit e1f2b666ff94f2b8a50ca000d69f5b5f0b89a27c)
Link: https://github.com/openwrt/openwrt/pull/21489
Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
package/base-files/files/lib/functions/network.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index 4851a5817a..54ca7b00d4 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -24,6 +24,17 @@ __network_ifstatus() {
eval "$__tmp"
}
+# determine the IAID of the given logical interface
+# 1: destination variable
+# 2: interface
+network_generate_iface_iaid() {
+ local __iaid
+
+ __iaid=$(printf '%s' "$2" | md5sum | cut -c 1-8)
+
+ export "$1=$__iaid"
+}
+
# determine first IPv4 address of given logical interface
# 1: destination variable
# 2: interface
More information about the lede-commits
mailing list