wlan-ap-Telecominfraproject/patches/0019-lldp-add-TIP-tweaks.patch
John Crispin 5c72b50975 ucentral: development update
* yet another huge data model 2 update

Signed-off-by: John Crispin <john@phrozen.org>
2021-05-18 10:56:09 +02:00

83 lines
2.4 KiB
Diff

From a5af4baec7cbe2a6ffe845d71fc15af00e022321 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Fri, 4 Dec 2020 16:29:35 +0100
Subject: [PATCH 01/19] lldp: add TIP tweaks
Signed-off-by: John Crispin <john@phrozen.org>
---
.../network/services/lldpd/files/lldpd.config | 16 ----------------
package/network/services/lldpd/files/lldpd.init | 11 ++++++++++-
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config
index 5e7c51ba7e..b37dda87bf 100644
--- a/package/network/services/lldpd/files/lldpd.config
+++ b/package/network/services/lldpd/files/lldpd.config
@@ -1,20 +1,4 @@
config lldpd config
- option enable_cdp 1
- option enable_fdp 1
- option enable_sonmp 1
- option enable_edp 1
-
option agentxsocket /var/run/agentx.sock
option lldp_class 4
- option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4"
-
- # if empty, the distribution description is sent
- #option lldp_description "OpenWrt System"
- #option lldp_hostname "Modified Hostname"
-
- #option lldp_mgmt_ip "!192.168.1.1"
-
- # interfaces to listen on
- list interface "loopback"
- list interface "lan"
diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 7a5b25e016..8d855a1856 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -10,6 +10,10 @@ LLDPSOCKET=/var/run/lldpd.socket
LLDPD_CONF=/tmp/lldpd.conf
LLDPD_CONFS_DIR=/tmp/lldpd.d
+service_triggers() {
+ procd_add_reload_trigger lldpd
+}
+
find_release_info()
{
[ -s /etc/os-release ] && . /etc/os-release
@@ -37,7 +41,7 @@ write_lldpd_conf()
local iface ifnames=""
for iface in $ifaces; do
local ifname=""
- if network_get_device ifname "$iface" || [ -e "/sys/class/net/$iface" ]; then
+ if [ -e "/sys/class/net/$iface" ]; then
append ifnames "${ifname:-$iface}" ","
fi
done
@@ -58,6 +62,7 @@ write_lldpd_conf()
start_service() {
+ local enable
local enable_cdp
local enable_fdp
local enable_sonmp
@@ -68,6 +73,10 @@ start_service() {
local agentxsocket
config_load 'lldpd'
+ config_get_bool enable 'config' 'enable' 0
+
+ [ "$enable" -eq 1 ] || return
+
config_get_bool enable_cdp 'config' 'enable_cdp' 0
config_get_bool enable_fdp 'config' 'enable_fdp' 0
config_get_bool enable_sonmp 'config' 'enable_sonmp' 0
--
2.25.1