Browse Source

Fix test_bgp_route_exchange: correct IP byte order constants and platform_compat.h endian include

congestion
Evgeny 6 months ago
parent
commit
389124d327
  1. 2
      lib/platform_compat.h
  2. 5
      tests/test_bgp_route_exchange.c

2
lib/platform_compat.h

@ -19,7 +19,7 @@
#include <stdlib.h>
#define htobe64(x) _byteswap_uint64(x)
#define be64toh(x) _byteswap_uint64(x)
#elif defined(__linux__)
#else
#include <endian.h>
#endif

5
tests/test_bgp_route_exchange.c

@ -244,15 +244,14 @@ static int verify_bgp_exchange(void) {
// Check server learned client's routes (192.168.20.0/24, 192.168.21.0/24)
DEBUG_INFO(DEBUG_CATEGORY_ROUTING, "Checking server learned client's routes...");
// Note: Routes are stored in host byte order, not network byte order
if (!check_learned_route(server_instance,0x0014a8c0,24,0x2222222222222222ULL)) {
if (!check_learned_route(server_instance,0xc0a81400,24,0x2222222222222222ULL)) {
DEBUG_ERROR(DEBUG_CATEGORY_ROUTING,"FAIL: Server missing learned route 192.168.20.0/24");
success = 0;
} else {
DEBUG_INFO(DEBUG_CATEGORY_ROUTING,"PASS: Server has learned route 192.168.20.0/24");
}
if (!check_learned_route(server_instance,0x0015a8c0,24,0x2222222222222222ULL)) {
if (!check_learned_route(server_instance,0xc0a81500,24,0x2222222222222222ULL)) {
DEBUG_ERROR(DEBUG_CATEGORY_ROUTING,"FAIL: Server missing learned route 192.168.21.0/24");
success = 0;
} else {

Loading…
Cancel
Save