From 7c8d80e76f93029437f9a52f04c9d02b0d55dd78 Mon Sep 17 00:00:00 2001 From: zhengjiebing Date: Tue, 16 Jan 2024 23:52:23 +0800 Subject: [PATCH] fix host_addr6 can be assigned a multicast address --- src/lstack/core/lstack_cfg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c index 87df790..5e30e89 100644 --- a/src/lstack/core/lstack_cfg.c +++ b/src/lstack/core/lstack_cfg.c @@ -250,6 +250,12 @@ static int32_t parse_host_addr6(void) if (ip6addr_aton(value, &g_config_params.host_addr6) == 0) { return -EINVAL; } + + if (ip6_addr_ismulticast(&g_config_params.host_addr6)) { + LSTACK_PRE_LOG(LSTACK_ERR, "cfg: host_addr6 cannot be a multicast address."); + return -EINVAL; + } + return 0; } -- 2.33.0