[openwrt/openwrt] lldpd: Allow neighbour filtering

LEDE Commits lede-commits at lists.infradead.org
Tue Sep 17 03:36:16 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/1d83e4c5ed766d4bf516229165f1713f170c5e63

commit 1d83e4c5ed766d4bf516229165f1713f170c5e63
Author: Stephen Howell <howels at allthatwemight.be>
AuthorDate: Sat Dec 16 22:52:10 2023 +0000

    lldpd: Allow neighbour filtering
    
    add filter option to init script.
    
    Signed-off-by: Stephen Howell <howels at allthatwemight.be>
    (cherry picked from commit ac3ed75309e7db93bf2316eccba8106e3fe8f9fc)
    Link: https://github.com/openwrt/openwrt/pull/15299
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 411fa0c652..48d15a4824 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -34,6 +34,7 @@ get_config_restart_hash() {
 	config_get      v 'config' 'lldp_class'; append _string "$v" ","
 	config_get      v 'config' 'agentxsocket'; append _string "$v" ","
 	config_get      v 'config' 'cid_interface'; append _string "$v" ","
+	config_get      v 'config' 'filter'; append _string "$v" ","
 	config_get_bool v 'config' 'readonly_mode'; append _string "$v" ","
 	config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" ","
 	config_get_bool v 'config' 'enable_cdp'; append _string "$v" ","
@@ -109,6 +110,7 @@ start_service() {
 	local lldp_location
 	local readonly_mode
 	local agentxsocket
+	local filter
 
 	config_load 'lldpd'
 	config_get_bool enable_cdp 'config' 'enable_cdp' 0
@@ -119,6 +121,7 @@ start_service() {
 	config_get lldp_location 'config' 'lldp_location'
 	config_get_bool readonly_mode 'config' 'readonly_mode' 0
 	config_get agentxsocket 'config' 'agentxsocket'
+	config_get filter 'config' 'filter' 15
 
 	mkdir -p ${LLDPD_RUN}
 	chown lldp:lldp ${LLDPD_RUN}
@@ -137,6 +140,7 @@ start_service() {
 	[ $readonly_mode -gt 0 ] && procd_append_param command '-r'
 	[ -n "$lldp_class" ] && procd_append_param command -M "$lldp_class"
 	[ -n "$agentxsocket" ] && procd_append_param command -x -X "$agentxsocket"
+	[ -n "$filter" ] && procd_append_param command -H "$filter"
 
     # ChassisID interfaces
 	local ifnames




More information about the lede-commits mailing list