From: Vincent Bernat Date: Thu, 14 May 2015 20:05:30 +0000 (+0200) Subject: tests: fix SNMP tests X-Git-Tag: 0.7.15~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d3c1ce032f877c4b2ed636dd145cd6362fbac08;p=thirdparty%2Flldpd.git tests: fix SNMP tests Management address need to be provided in network byte order. --- diff --git a/src/lldpd-structs.h b/src/lldpd-structs.h index 93b435e4..43795de7 100644 --- a/src/lldpd-structs.h +++ b/src/lldpd-structs.h @@ -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; diff --git a/tests/check_snmp.c b/tests/check_snmp.c index e2fa6b2e..b0bd45ba 100644 --- a/tests/check_snmp.c +++ b/tests/check_snmp.c @@ -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 };