]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: fix SNMP tests
authorVincent Bernat <vincent@bernat.im>
Thu, 14 May 2015 20:05:30 +0000 (22:05 +0200)
committerVincent Bernat <vincent@bernat.im>
Thu, 14 May 2015 20:05:30 +0000 (22:05 +0200)
Management address need to be provided in network byte order.

src/lldpd-structs.h
tests/check_snmp.c

index 93b435e45db668f9bc707d5c0c79e83fe1effd40..43795de7943fc64b09890de509a96d673efd034a 100644 (file)
@@ -154,7 +154,7 @@ struct lldpd_mgmt {
        union {
                struct in_addr          inet;
                struct in6_addr         inet6;
-               u_int8_t                        octets[LLDPD_MGMT_MAXADDRSIZE];
+               u_int8_t                octets[LLDPD_MGMT_MAXADDRSIZE]; /* network byte order! */
        } m_addr;
        size_t                  m_addrsize;
        u_int32_t               m_iface;
index e2fa6b2ed2c6c0f4b1112db2cde6ba6028c4a719..b0bd45bad35e4da9b99bc80ddcb79027d7bd6e7b 100644 (file)
@@ -41,7 +41,7 @@ struct timeval test_starttime = { .tv_sec = 100, .tv_usec = 0 };
 /* First chassis */
 struct lldpd_mgmt mgmt1 = {
                .m_family = LLDPD_AF_IPV4,
-               .m_addr = { .inet = { 251789504 } }, /* 192.0.2.15 */
+               .m_addr = { .octets = { 0xc0, 0, 0x2, 0xf } }, /* 192.0.2.15 */
                .m_addrsize = sizeof(struct in_addr),
                .m_iface = 3
 };
@@ -73,7 +73,7 @@ struct lldpd_chassis chassis1 = {
 /* Second chassis */
 struct lldpd_mgmt mgmt2 = {
                .m_family = LLDPD_AF_IPV4,
-               .m_addr = { .inet = { 285343936 } }, /* 192.0.2.17 */
+               .m_addr = { .octets = { 0xc0, 0, 0x2, 0x11 } }, /* 192.0.2.17 */
                .m_addrsize = sizeof(struct in_addr),
                .m_iface = 5
 };