From 845b5afa76205cf1eaffc966257eb62ea64af837 Mon Sep 17 00:00:00 2001
From: yinbin <yinbin8@huawei.com>
Date: Sat, 4 Nov 2023 19:18:12 +0800
Subject: [PATCH] cfg: fix bond_mode null

---
 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 c4278b5..8e83c0d 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -1119,6 +1119,11 @@ static int32_t parse_bond_mode(void)
 {
     const config_setting_t *bond_mode = NULL;
     bond_mode = config_lookup(&g_config, "bond_mode");
+    if (bond_mode == NULL) {
+        g_config_params.bond_mode = -1;
+        return 0;
+    }
+
     g_config_params.bond_mode = config_setting_get_int(bond_mode);
     if (g_config_params.bond_mode == -1) {
         return 0;
-- 
2.27.0

