]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldp: fix display of unknown organizational ID
authorVincent Bernat <vincent@bernat.im>
Wed, 10 Dec 2014 16:09:30 +0000 (17:09 +0100)
committerVincent Bernat <vincent@bernat.im>
Wed, 10 Dec 2014 16:09:30 +0000 (17:09 +0100)
Because it was stored in a signed char array, it was incorrectly
displayed with the "%x" formatter. Store it into an unsigned char array.

src/daemon/lldp.c

index ae01ccc5078a00cfa6bfa1df6e4a352c98a45955..3d0a988b9fe55d8bfeac7a340e07aaa04fec1795 100644 (file)
@@ -483,7 +483,7 @@ lldp_decode(struct lldpd *cfg, char *frame, int s,
        const char dot3[] = LLDP_TLV_ORG_DOT3;
        const char med[] = LLDP_TLV_ORG_MED;
        const char dcbx[] = LLDP_TLV_ORG_DCBX;
-       char orgid[3];
+       unsigned char orgid[3];
        int length, gotend = 0, ttl_received = 0;
        int tlv_size, tlv_type, tlv_subtype;
        u_int8_t *pos, *tlv;