[openwrt/openwrt] lldpd: get_config_cid_ifaces() -> get_interface_csv()

LEDE Commits lede-commits at lists.infradead.org
Tue Mar 25 01:52:59 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/bde35a6c7d211ca88c4b4af7f63f9c7c5cebfa07

commit bde35a6c7d211ca88c4b4af7f63f9c7c5cebfa07
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Sun Apr 21 23:18:36 2024 +0200

    lldpd: get_config_cid_ifaces() -> get_interface_csv()
    
    where csv = comma separated value(s)
    
    Make the function more generic. Can use it for not only 'config'.
    
    Now it can be used to parse interfaces for additional lldpd settings,
    e.g. custom-tlv.
    
    Tested on: 22.03.6
    
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/14872
    (cherry picked from commit a015f59880c72a1bdd07de32491f85ce7f8d2a1c)
    Link: https://github.com/openwrt/openwrt/pull/18343
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 6c1c184bfa..2ad59f8cb1 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -75,9 +75,9 @@ get_config_restart_hash() {
 	export -n "$var=$_hash"
 }
 
-get_config_cid_ifaces() {
+get_interface_csv() {
 	local _ifaces
-	config_get _ifaces 'config' "$2"
+	config_get _ifaces "$2" "$3"
 
 	local _iface _ifnames=""
 	# Set noglob to prevent '*' capturing diverse file names in the for ... in
@@ -109,7 +109,7 @@ write_lldpd_conf()
 	config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)"
 
 	local ifnames
-	get_config_cid_ifaces ifnames "interface"
+	get_interface_csv ifnames 'config' "interface"
 
 	local lldp_mgmt_ip
 	config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'
@@ -335,7 +335,7 @@ start_service() {
 
     # ChassisID interfaces
 	local ifnames
-	get_config_cid_ifaces ifnames "cid_interface"
+	get_interface_csv ifnames 'config' "cid_interface"
 
 	[ -n "$ifnames" ] && procd_append_param command -C "$ifnames"
 




More information about the lede-commits mailing list