]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon/lldp: fix warning message about out of order TLVs
authorVincent Bernat <vincent@bernat.ch>
Tue, 7 Nov 2023 07:17:29 +0000 (08:17 +0100)
committerVincent Bernat <vincent@bernat.ch>
Tue, 7 Nov 2023 07:39:53 +0000 (08:39 +0100)
Fix #616

src/daemon/protocols/lldp.c

index 64d344730dfc06861fd82d057ed38edd0622c53f..6e732373955d974e3fcfb323e81d10885909a27d 100644 (file)
@@ -664,24 +664,24 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardwa
                case LLDP_TLV_CHASSIS_ID:
                        if (tlv_count != 1) {
                                log_warnx("lldp",
-                                   "first TLV should be a chassis ID on %s, not %d",
-                                   hardware->h_ifname, tlv_type);
+                                   "Chassis ID TLV should be first on %s, but it is on position %d",
+                                   hardware->h_ifname, tlv_count);
                                goto malformed;
                        }
                        break;
                case LLDP_TLV_PORT_ID:
                        if (tlv_count != 2) {
                                log_warnx("lldp",
-                                   "second TLV should be a port ID on %s, not %d",
-                                   hardware->h_ifname, tlv_type);
+                                   "Port ID TLV should be second on %s, but it is on position %d",
+                                   hardware->h_ifname, tlv_count);
                                goto malformed;
                        }
                        break;
                case LLDP_TLV_TTL:
                        if (tlv_count != 3) {
                                log_warnx("lldp",
-                                   "third TLV should be a TTL on %s, not %d",
-                                   hardware->h_ifname, tlv_type);
+                                   "TTL TLV should be third on %s, but it is on position %d",
+                                   hardware->h_ifname, tlv_count);
                                goto malformed;
                        }
                        break;