For certain lldp_class scenarios (2 & 3) a policy must be set also.
Class 4 is default, although it's good to handle the policy eventuality.
Here, set a default lldp_policy for all lldp_class scenarios. Any
lldp_policy can now be set.
Depends on PR #14584 (which introduced an `if` block)
Tested on 22.03.5, 22.03.6
Signed-off-by: Paul Donald <newtwen@gmail.com>
PKG_NAME:=lldpd
PKG_VERSION:=1.0.17
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
option agentxsocket /var/run/agentx.sock
option lldp_class 4
+ # lldp_policy only needed for lldp_class 2-3
+ # option lldp_policy 'application streaming-video unknown'
option lldp_location "address country EU"
# if empty, the distribution description is sent
local lldp_location
config_get lldp_location 'config' 'lldp_location'
+ local lldp_class
+ config_get lldp_class 'config' 'lldp_class'
+
+ local lldp_policy
+ config_get lldp_policy 'config' 'lldp_policy'
+
fi
local lldp_agenttype
[ -n "$lldp_location" ] && echo "configure med location" "$lldp_location" >> "$LLDPD_CONF"
+ # Manual states that if Class (-M) is 2 or 3, at least one network policy must be defined
+ case "$lldp_class" in
+ 2 | 3 ) [ -n "$lldp_policy" ] && echo "configure med policy $lldp_policy" >> "$LLDPD_CONF"
+ ;;
+ esac
+
fi
[ -n "$lldp_agenttype" ] && echo "configure lldp agent-type" "\"$lldp_agenttype\"" >> "$LLDPD_CONF"