From 677536dd7433a814936427908d5adda45a33bff0 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Tue, 13 Oct 2026 03:24:55 +0200 Subject: [PATCH] lldp: send the port id as an interface name The Port ID TLV carried a single digit with the locally assigned subtype, so a neighbour listed us as port "3". Send "Port 3" with the interface name subtype instead, the form the port keeps in the CLI and the web UI. --- rtl837x_lldp.c | 2 ++ rtl837x_lldp.h | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rtl837x_lldp.c b/rtl837x_lldp.c index 84208433..3eb644ea 100644 --- a/rtl837x_lldp.c +++ b/rtl837x_lldp.c @@ -76,6 +76,8 @@ void lldp_send(void) __banked __reentrant *p++ = LLDP_TYPE(LLDP_PORT_ID_TLV_TYPE); *p++ = LLDP_PORT_ID_TLV_LENGTH; *p++ = LLDP_PORT_ID_TLV_SUBTYPE; + memcpyc(p, LLDP_PORT_ID_PREFIX, LLDP_PORT_ID_PREFIX_LENGTH); + p += LLDP_PORT_ID_PREFIX_LENGTH; port_position = (p-LLDP_O->payload); *p++ = '0'; // filled in per port below diff --git a/rtl837x_lldp.h b/rtl837x_lldp.h index 298775c6..4a48e121 100644 --- a/rtl837x_lldp.h +++ b/rtl837x_lldp.h @@ -11,8 +11,10 @@ #define LLDP_TX_INTERVAL_TICKS 6000 #define LLDP_PORT_ID_TLV_TYPE 2 -#define LLDP_PORT_ID_TLV_LENGTH 0x02 -#define LLDP_PORT_ID_TLV_SUBTYPE 0x07 +#define LLDP_PORT_ID_PREFIX "Port " +#define LLDP_PORT_ID_PREFIX_LENGTH 5 +#define LLDP_PORT_ID_TLV_LENGTH (1 + LLDP_PORT_ID_PREFIX_LENGTH + 1) +#define LLDP_PORT_ID_TLV_SUBTYPE 0x05 #define LLDP_TTL_TLV_TYPE 3 #define LLDP_TTL_TLV_LENGTH 2