gazelle/0174-CFG-set-multicast-IP-assert.patch
2024-06-14 17:12:22 +08:00

29 lines
807 B
Diff

From 38f5dbd34dfede9fc4a22c89903132fafc01fc6d Mon Sep 17 00:00:00 2001
From: yinbin6 <yinbin8@huawei.com>
Date: Mon, 29 Apr 2024 17:07:15 +0800
Subject: [PATCH] CFG:set multicast IP assert
---
src/lstack/core/lstack_cfg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index 533eb6c..319a720 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -244,6 +244,11 @@ static int32_t parse_host_addr(void)
if (g_config_params.host_addr.addr == INADDR_NONE) {
return -EINVAL;
}
+
+ if (IN_MULTICAST(g_config_params.host_addr.addr)) {
+ LSTACK_PRE_LOG(LSTACK_ERR, "cfg: host_addr:%s should not be a multicast IP.", value);
+ return -EINVAL;
+ }
return 0;
}
--
2.33.0