]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldp: don't discard the whole LLDPDU when only one TLV is invalid
authorVincent Bernat <vincent@bernat.ch>
Thu, 21 Nov 2019 19:13:38 +0000 (20:13 +0100)
committerVincent Bernat <vincent@bernat.ch>
Thu, 21 Nov 2019 19:13:38 +0000 (20:13 +0100)
IEEE802.1AB-2005 says:

> If TLV_type_value is in the range of reserved TLV types in Table
> 9-1, the TLV is unrecognized and may be a basic TLV from a later
> LLDP version. The statsTLVsUnrecognizedTotal counter shall be
> incremented, and the TLV shall be assumed to be validated.

Fix #323

src/daemon/protocols/lldp.c

index 2609d6d4c117ac9a59da1de305c30cc7c04c6e6a..a670503813e1c204e716d415d59de50368e0d1a8 100644 (file)
@@ -1253,7 +1253,7 @@ lldp_decode(struct lldpd *cfg, char *frame, int s,
                        log_warnx("lldp", "unknown tlv (%d) received on %s",
                            tlv_type, hardware->h_ifname);
                        hardware->h_rx_unrecognized_cnt++;
-                       goto malformed;
+                       break;
                }
                if (pos > tlv + tlv_size) {
                        log_warnx("lldp", "BUG: already past TLV!");