Skip to content

lldp: Tolerate multiple management address TLVs - #130

Open
thwalsh wants to merge 1 commit into
intel:masterfrom
thwalsh:tolerate-multiple-tlv-type-8
Open

lldp: Tolerate multiple management address TLVs#130
thwalsh wants to merge 1 commit into
intel:masterfrom
thwalsh:tolerate-multiple-tlv-type-8

Conversation

@thwalsh

@thwalsh thwalsh commented Jul 25, 2026

Copy link
Copy Markdown

Unlike the other basic TLV types (System Name, Port Description, etc.), the Management Address TLV may appear more than once in a single LLDPDU, e.g. one per address family (IPv4, IPv6). Switches commonly do this.

Commit 44006eb ("lldp: Reject frames with duplicate TLVs") treated a second Management Address TLV as a fatal frame error and aborted processing the entire frame with goto out. This caused all subsequent TLVs (including 802.1Qaz ETS/PFC/APP TLVs and the End TLV) to be skipped, resulting in the ETS state machine never receiving the peer's configuration.

This broke PFC/ETS learning from switches that send multiple Management Address TLVs, such as Nvidia Cumulus Linux switches (MSN4600, MSN4700).

Fix by removing the checks for if an additional TLV type 8 is received. Instead leaving the idempotent check that the RCVD_LLDP_TLV_TYPE8 bit is set and then freeing the tlv and continuing on with the processing of TLVs.

Due to mgmtadd being write-only, it has been removed as there is no need for it in rxProcessFrame.

Unlike the other basic TLV types (System Name, Port Description, etc.),
the Management Address TLV may appear more than once in a single LLDPDU,
e.g. one per address family (IPv4, IPv6). Switches commonly do this.

Commit 44006eb ("lldp: Reject frames with duplicate TLVs") treated
a second Management Address TLV as a fatal frame error and aborted
processing the entire frame with `goto out`. This caused all subsequent
TLVs (including 802.1Qaz ETS/PFC/APP TLVs and the End TLV) to be
skipped, resulting in the ETS state machine never receiving the peer's
configuration.

This broke PFC/ETS learning from switches that send multiple Management
Address TLVs, such as Nvidia Cumulus Linux switches (MSN4600, MSN4700).

Fix by removing the checks for if an additional TLV type 8 is received.
Instead leaving the idempotent check that the RCVD_LLDP_TLV_TYPE8 bit
is set and then freeing the tlv and continuing on with the processing
of TLVs.

Due to mgmtadd being write-only, it has been removed as there is no
need for it in rxProcessFrame.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: Thomas Walsh <thwalsh@redhat.com>
@penguin359

Copy link
Copy Markdown
Contributor

First scan through the patch looks completely reasonable. Will take a closer look and try to test this in the lab.

@thwalsh

thwalsh commented Jul 27, 2026

Copy link
Copy Markdown
Author

Thanks for taking a look. I was testing via scapy and just simply creating a LLDPDU that had > 1 TLV type 8.

@apconole

apconole commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Just a quick look through - is tlv_stored being handled properly? Also, why was the assignment location changed with this commit - seems like a separate logical change to me.

@thwalsh

thwalsh commented Aug 3, 2026

Copy link
Copy Markdown
Author

Hey there @apconole , I appreciate you taking a look.

tlv_stored is still handled properly even though it is no longer handled within the TYPE_8 branch. Now the TYPE_8 branch will simply ensure the RCVD_LLDP_TLV_TYPE8 bit is set, free the TLV and continue with processing of subsequent TLVs.

The assignment was moved to the top of the loop before the parsing, allowing for the TYPE_8 branch to utilize a continue statement instead of a goto that would've required jumping to the bottom of the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants