From 9f7898bade5dd2732e99c3d17f30c34709caa770 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 17 Feb 2025 17:17:25 +0100 Subject: [PATCH] tests: net: conn_mgr: Use valid LL address in tests Using L2 address of length 1 (invalid/unsupported one) confused IPv6 layer during LL address generation - since that length was not a valid one, the address was not initialized properly and a part of it was set semi-random. This could result for example in filling out the neighbor tables. Signed-off-by: Robert Lubos (cherry picked from commit 3089a5d116ab538a568c1617afccd481e274180a) --- tests/net/conn_mgr_conn/src/test_ifaces.c | 2 +- tests/net/conn_mgr_monitor/src/test_ifaces.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/net/conn_mgr_conn/src/test_ifaces.c b/tests/net/conn_mgr_conn/src/test_ifaces.c index 535eee07de80..bd21197160a5 100644 --- a/tests/net/conn_mgr_conn/src/test_ifaces.c +++ b/tests/net/conn_mgr_conn/src/test_ifaces.c @@ -16,7 +16,7 @@ static void test_iface_init(struct net_if *iface) { /* Fake link layer address is needed to silence assertions inside the net core */ - static uint8_t fake_lladdr[] = { 0x01 }; + static uint8_t fake_lladdr[] = { 0x00, 0x00, 0x5E, 0x00, 0x53, 0x01 }; net_if_set_link_addr(iface, fake_lladdr, sizeof(fake_lladdr), NET_LINK_DUMMY); diff --git a/tests/net/conn_mgr_monitor/src/test_ifaces.c b/tests/net/conn_mgr_monitor/src/test_ifaces.c index 1b7a5080ec1f..05eda78dfcf7 100644 --- a/tests/net/conn_mgr_monitor/src/test_ifaces.c +++ b/tests/net/conn_mgr_monitor/src/test_ifaces.c @@ -15,7 +15,7 @@ static void test_iface_init(struct net_if *iface) { /* Fake link layer address is needed to silence assertions inside the net core */ - static uint8_t fake_lladdr[] = { 0x01 }; + static uint8_t fake_lladdr[] = { 0x00, 0x00, 0x5E, 0x00, 0x53, 0x01 }; net_if_set_link_addr(iface, fake_lladdr, sizeof(fake_lladdr), NET_LINK_DUMMY);