From 8317658710e9f8e454319b7383177b81bf9ec19c Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 7 Nov 2023 08:17:29 +0100 Subject: [PATCH] daemon/lldp: fix warning message about out of order TLVs Fix #616 --- src/daemon/protocols/lldp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/daemon/protocols/lldp.c b/src/daemon/protocols/lldp.c index 64d34473..6e732373 100644 --- a/src/daemon/protocols/lldp.c +++ b/src/daemon/protocols/lldp.c @@ -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; -- 2.39.5