public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lldpd: Enable support for cisco discovery protocol
@ 2025-11-11 20:01 Stefan Schantl
  2025-11-11 20:01 ` [PATCH 2/2] lldpd: Set green address as management address Stefan Schantl
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Schantl @ 2025-11-11 20:01 UTC (permalink / raw)
  To: development; +Cc: Stefan Schantl

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 src/initscripts/system/lldpd | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/initscripts/system/lldpd b/src/initscripts/system/lldpd
index 128115dbb..42b0cb9d7 100755
--- a/src/initscripts/system/lldpd
+++ b/src/initscripts/system/lldpd
@@ -22,6 +22,8 @@
 . /etc/sysconfig/rc
 . ${rc_functions}
 
+LLDPDARGS=""
+
 # Read the configuration
 readhash CONFIG "/var/ipfire/lldp/settings"
 
@@ -34,6 +36,9 @@ generate_config() {
 	return 0
 }
 
+# Enable support for Cisco Discovery Protocol (CDP)
+LLDPDARGS+="-c"
+
 case "${1}" in
 	start)
 		# Do nothing if the service is not enabled
@@ -49,7 +54,7 @@ case "${1}" in
 		fi
 
 		boot_mesg "Starting Link-Layer Discovery Protocol Daemon..."
-		loadproc /usr/sbin/lldpd
+		loadproc /usr/sbin/lldpd ${LLDPDARGS}
 		;;
 
 	stop)
-- 
2.47.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] lldpd: Set green address as management address
  2025-11-11 20:01 [PATCH 1/2] lldpd: Enable support for cisco discovery protocol Stefan Schantl
@ 2025-11-11 20:01 ` Stefan Schantl
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Schantl @ 2025-11-11 20:01 UTC (permalink / raw)
  To: development; +Cc: Stefan Schantl

At default the first available IP address (which heavily depends on your
and your ISP assigned addresses) will be used as management address.

This patch changes this behaviour to set the address of the green zone
as management address and broadcast it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 src/initscripts/system/lldpd | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/initscripts/system/lldpd b/src/initscripts/system/lldpd
index 42b0cb9d7..9b2cbcaf4 100755
--- a/src/initscripts/system/lldpd
+++ b/src/initscripts/system/lldpd
@@ -27,6 +27,9 @@ LLDPDARGS=""
 # Read the configuration
 readhash CONFIG "/var/ipfire/lldp/settings"
 
+# Read-in network settings
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
 generate_config() {
 	# Set the description (if given)
 	if [ -n "${CONFIG["DESCRIPTION"]}" ]; then
@@ -53,6 +56,11 @@ case "${1}" in
 			exit 1
 		fi
 
+		# Set green address as management address if there is one.
+		if [ -n ${GREEN_ADDRESS} ]; then
+			LLDPDARGS+=" -m ${GREEN_ADDRESS}"
+		fi
+
 		boot_mesg "Starting Link-Layer Discovery Protocol Daemon..."
 		loadproc /usr/sbin/lldpd ${LLDPDARGS}
 		;;
-- 
2.47.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-11 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-11 20:01 [PATCH 1/2] lldpd: Enable support for cisco discovery protocol Stefan Schantl
2025-11-11 20:01 ` [PATCH 2/2] lldpd: Set green address as management address Stefan Schantl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox