projects
/
openwrt
/
staging
/
jow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58056df
)
base-files: enable get_mac_ascii() to handle redundant strings
author
Shiji Yang
<
[email protected]
>
Fri, 13 Dec 2024 05:30:38 +0000
(13:30 +0800)
committer
Hauke Mehrtens
<
[email protected]
>
Sat, 4 Jan 2025 15:20:46 +0000
(16:20 +0100)
The function get_mac_ascii() will fail when there are two or more
same MAC address variable names in the mtd partition. Only retain
the first variable to workaround this rare situation.
Fixes: https://github.com/openwrt/openwrt/issues/17236
Signed-off-by: Shiji Yang <
[email protected]
>
Link:
https://github.com/openwrt/openwrt/pull/17262
Signed-off-by: Hauke Mehrtens <
[email protected]
>
package/base-files/files/lib/functions/system.sh
patch
|
blob
|
history
diff --git
a/package/base-files/files/lib/functions/system.sh
b/package/base-files/files/lib/functions/system.sh
index 048e32f0e164147b3b73211c015323cf241f9167..aaeb75f26164af6bac0820eb629a768ca65a5a90 100644
(file)
--- a/
package/base-files/files/lib/functions/system.sh
+++ b/
package/base-files/files/lib/functions/system.sh
@@
-66,7
+66,7
@@
get_mac_ascii() {
local key="$2"
local mac_dirty
- mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p')
+ mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p'
| head -n 1
)
# "canonicalize" mac
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"