diff mbox series

[v2,2/7] lldpd: get_config_cid_ifaces() -> get_interface_csv_pattern()

Message ID 20240409034405.78194-3-newtwen+github@gmail.com
State New
Headers show
Series lldpd: various improvements | expand

Commit Message

Paul Donald April 9, 2024, 3:41 a.m. UTC
Make the function more generic. Can use it for not only 'config'.

Now it can be used to parse interfaces for additional lldpd settings

Tested on: 22.03.6

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index fc53520c5b..069c8fee80 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -75,10 +75,10 @@  get_config_restart_hash() {
 	export -n "$var=$_hash"
 }
 
-get_config_cid_ifaces() {
+get_interface_csv_pattern() {
 	set -o noglob
 	local _ifaces
-	config_get _ifaces 'config' "$2"
+	config_get _ifaces "$2" "$3"
 
 	local _iface _ifnames=""
 	for _iface in $_ifaces; do
@@ -115,7 +115,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_pattern ifnames 'config' "interface"
 
 	local lldp_mgmt_ip
 	config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'
@@ -327,7 +327,7 @@  start_service() {
 
     # ChassisID interfaces
 	local ifnames
-	get_config_cid_ifaces ifnames "cid_interface"
+	get_interface_csv_pattern ifnames 'config' "cid_interface"
 
 	[ -n "$ifnames" ] && procd_append_param command -C "$ifnames"