From 389124d327349a6ff9f8cd1474b008585cbcbb38 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 13 Apr 2026 14:05:32 +0300 Subject: [PATCH] Fix test_bgp_route_exchange: correct IP byte order constants and platform_compat.h endian include --- lib/platform_compat.h | 2 +- tests/test_bgp_route_exchange.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/platform_compat.h b/lib/platform_compat.h index b828b256..b5b67d5b 100644 --- a/lib/platform_compat.h +++ b/lib/platform_compat.h @@ -19,7 +19,7 @@ #include #define htobe64(x) _byteswap_uint64(x) #define be64toh(x) _byteswap_uint64(x) -#elif defined(__linux__) +#else #include #endif diff --git a/tests/test_bgp_route_exchange.c b/tests/test_bgp_route_exchange.c index a033eb87..a43aee6e 100644 --- a/tests/test_bgp_route_exchange.c +++ b/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 {