mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-11-01 18:04:12 +08:00
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.
This commit is contained in:
1 parent
1856aeba28
commit
677536dd74
2 files changed
+6
-2
No files matched your search
@@ -76,6 +76,8 @@ void lldp_send(void) __banked __reentrant
|
|||||||
*p++ = LLDP_TYPE(LLDP_PORT_ID_TLV_TYPE);
|
*p++ = LLDP_TYPE(LLDP_PORT_ID_TLV_TYPE);
|
||||||
*p++ = LLDP_PORT_ID_TLV_LENGTH;
|
*p++ = LLDP_PORT_ID_TLV_LENGTH;
|
||||||
*p++ = LLDP_PORT_ID_TLV_SUBTYPE;
|
*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);
|
port_position = (p-LLDP_O->payload);
|
||||||
*p++ = '0'; // filled in per port below
|
*p++ = '0'; // filled in per port below
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -11,8 +11,10 @@
|
|||||||
#define LLDP_TX_INTERVAL_TICKS 6000
|
#define LLDP_TX_INTERVAL_TICKS 6000
|
||||||
|
|
||||||
#define LLDP_PORT_ID_TLV_TYPE 2
|
#define LLDP_PORT_ID_TLV_TYPE 2
|
||||||
#define LLDP_PORT_ID_TLV_LENGTH 0x02
|
#define LLDP_PORT_ID_PREFIX "Port "
|
||||||
#define LLDP_PORT_ID_TLV_SUBTYPE 0x07
|
#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_TYPE 3
|
||||||
#define LLDP_TTL_TLV_LENGTH 2
|
#define LLDP_TTL_TLV_LENGTH 2
|
||||||
|
|||||||
Reference in new issue
Block a user