2022-06-01 10:43:17 +08:00
|
|
|
From a96ad33008671e61bddebb744a7ac0aa3798313b Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
|
|
|
|
|
Date: Thu, 2 Jun 2022 10:33:07 +0800
|
2022-06-22 14:54:52 +08:00
|
|
|
Subject: [PATCH 13/30] fix get_network_namespace_path check
|
2022-06-01 10:43:17 +08:00
|
|
|
|
|
|
|
|
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
src/daemon/modules/spec/specs_namespace.c | 5 ++---
|
|
|
|
|
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/src/daemon/modules/spec/specs_namespace.c b/src/daemon/modules/spec/specs_namespace.c
|
|
|
|
|
index 3888f556..2bf4cc36 100644
|
|
|
|
|
--- a/src/daemon/modules/spec/specs_namespace.c
|
|
|
|
|
+++ b/src/daemon/modules/spec/specs_namespace.c
|
|
|
|
|
@@ -200,13 +200,12 @@ int get_network_namespace_path(const host_config *host_spec,
|
|
|
|
|
{ SHARE_NAMESPACE_FILE, handle_get_path_from_file },
|
|
|
|
|
};
|
|
|
|
|
size_t jump_table_size = sizeof(handler_jump_table) / sizeof(handler_jump_table[0]);
|
|
|
|
|
- const char *network_mode = NULL;
|
|
|
|
|
+ const char *network_mode = host_spec->network_mode;
|
|
|
|
|
|
|
|
|
|
- if (host_spec == NULL || network_mode == NULL || dest_path == NULL) {
|
|
|
|
|
+ if (network_mode == NULL || dest_path == NULL) {
|
|
|
|
|
ERROR("Invalid input");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
- network_mode = host_spec->network_mode;
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < jump_table_size; ++index) {
|
|
|
|
|
if (strncmp(network_mode, handler_jump_table[index].mode, strlen(handler_jump_table[index].mode)) == 0) {
|
|
|
|
|
--
|
2022-06-22 14:54:52 +08:00
|
|
|
2.32.1 (Apple Git-133)
|
2022-06-01 10:43:17 +08:00
|
|
|
|