Commit c23b5a5f authored by Adam Wujek's avatar Adam Wujek 💬

Kconfig: allow disabling LLDP on the management port

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent c187ed89
...@@ -927,6 +927,13 @@ config LLDPD_DISABLE ...@@ -927,6 +927,13 @@ config LLDPD_DISABLE
help help
Disable LLDP daemon to prevent sending LLDP frames. It may be useful Disable LLDP daemon to prevent sending LLDP frames. It may be useful
for networks not using LLDP or with a low latency requirement. for networks not using LLDP or with a low latency requirement.
config LLDPD_MANAGEMENT_PORT_DISABLE
bool "Disable LLDP on the management port"
default n
depends on !LLDPD_DISABLE
help
Disable LLDP traffic on management port.
endmenu endmenu
config HTTPD_DISABLE config HTTPD_DISABLE
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
LLDPD_CONFIG=/etc/lldpd.conf LLDPD_CONFIG=/etc/lldpd.conf
LLDPD=/usr/sbin/lldpd LLDPD=/usr/sbin/lldpd
LLDPD_CLI=/usr/sbin/lldpcli
# -x -- Enable SNMP subagent. # -x -- Enable SNMP subagent.
LLDPD_OPT=-x LLDPD_OPT=-x
MONIT=/usr/bin/monit MONIT=/usr/bin/monit
...@@ -26,11 +27,6 @@ start_counter() { ...@@ -26,11 +27,6 @@ start_counter() {
start() { start() {
echo -n "Creating lldpd config: "
echo "configure system hostname '$(hostname)'" > $LLDPD_CONFIG
echo "configure system description 'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG
echo "resume" >> $LLDPD_CONFIG
echo "OK"
echo -n "Starting lldpd: " echo -n "Starting lldpd: "
...@@ -51,6 +47,16 @@ start() { ...@@ -51,6 +47,16 @@ start() {
echo -n "Force start of lldpd: " echo -n "Force start of lldpd: "
fi fi
# Creating lldpd config
echo "# This configuration file was generated by $0 at startup" > $LLDPD_CONFIG
echo "# If you would like to change a lldpd configuration in runtime please consider using lldpcli" >> $LLDPD_CONFIG
echo "configure system hostname '$(hostname)'" >> $LLDPD_CONFIG
echo "configure system description 'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG
if [ "$CONFIG_LLDPD_MANAGEMENT_PORT_DISABLE" = "y" ]; then
echo "configure system interface pattern '!eth*'" >> $LLDPD_CONFIG
fi
echo "resume" >> $LLDPD_CONFIG
start-stop-daemon -S -q -p /var/run/lldpd.pid --exec $LLDPD -- $LLDPD_OPT start-stop-daemon -S -q -p /var/run/lldpd.pid --exec $LLDPD -- $LLDPD_OPT
ret=$? ret=$?
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment