lldpd: fix config for build without LLDP-MED
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run

The lldp_class and lldp_location config option are only valid when
compiled with LLDP-MED support. If not they will cause lldpd not to
start.

Signed-off-by: Sebastian Pflieger <sebastian@pflieger.email>
Link: https://github.com/openwrt/openwrt/pull/17571
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Sebastian Pflieger 2025-01-09 18:10:38 +01:00 committed by Robert Marko
parent dac8021297
commit 2c22d7c3a4
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lldpd PKG_NAME:=lldpd
PKG_VERSION:=1.0.18 PKG_VERSION:=1.0.18
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/ PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
@ -90,6 +90,8 @@ endif
ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y) ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y)
sed -i -e 's/CONFIG_LLDPD_WITH_LLDPMED=y/CONFIG_LLDPD_WITH_LLDPMED=n/g' $(1)/etc/init.d/lldpd sed -i -e 's/CONFIG_LLDPD_WITH_LLDPMED=y/CONFIG_LLDPD_WITH_LLDPMED=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd
sed -i -e '/lldp_class/d' $(1)/etc/config/lldpd
sed -i -e '/lldp_location/d' $(1)/etc/config/lldpd
endif endif
endef endef

View File

@ -39,7 +39,6 @@ get_config_restart_hash() {
config_load 'lldpd' config_load 'lldpd'
config_get v 'config' 'lldp_class'; append _string "$v" ","
if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then
config_get v 'config' 'agentxsocket'; append _string "$v" "," config_get v 'config' 'agentxsocket'; append _string "$v" ","
fi fi
@ -49,6 +48,7 @@ get_config_restart_hash() {
config_get_bool v 'config' 'lldp_no_version'; append _string "$v" "," config_get_bool v 'config' 'lldp_no_version'; append _string "$v" ","
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
config_get_bool v 'config' 'lldpmed_no_inventory'; append _string "$v" "," config_get_bool v 'config' 'lldpmed_no_inventory'; append _string "$v" ","
config_get v 'config' 'lldp_class'; append _string "$v" ","
fi fi
config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" "," config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" ","
config_get_bool v 'config' 'force_lldp'; append _string "$v" "," config_get_bool v 'config' 'force_lldp'; append _string "$v" ","
@ -243,10 +243,10 @@ start_service() {
config_get_bool enable_edp 'config' 'enable_edp' 0 config_get_bool enable_edp 'config' 'enable_edp' 0
config_get_bool force_edp 'config' 'force_edp' 0 config_get_bool force_edp 'config' 'force_edp' 0
fi fi
config_get lldp_class 'config' 'lldp_class'
config_get_bool lldp_no_version 'config' 'lldp_no_version' 0 config_get_bool lldp_no_version 'config' 'lldp_no_version' 0
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
config_get_bool lldpmed_no_inventory 'config' 'lldpmed_no_inventory' 0 config_get_bool lldpmed_no_inventory 'config' 'lldpmed_no_inventory' 0
config_get lldp_class 'config' 'lldp_class'
fi fi
config_get_bool readonly_mode 'config' 'readonly_mode' 0 config_get_bool readonly_mode 'config' 'readonly_mode' 0
if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then