mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2026-06-11 05:47:27 -04:00
base-files: introduce a function to generate IAID
Add new function "network_generate_iface_iaid()" to generate a stable IAID from an interface name. Link: https://github.com/openwrt/openwrt/pull/21489 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user