diff options
| author | wangmenglan <[email protected]> | 2023-12-25 11:04:58 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2023-12-25 14:45:02 +0800 |
| commit | b4e0025e30823b40e71ab00b3c0061a4507ed1c2 (patch) | |
| tree | 524daaed28aa5272066a8f12bae96eb5fc7cf343 /platform | |
| parent | 744a020a07b9081a2c96abf8eba1f8f9e4873ea2 (diff) | |
bugfix TSG-18106:删除SCE网关默认值127.0.0.1v1.2.7-20231225
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/src/health_check.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/src/health_check.cpp b/platform/src/health_check.cpp index 7096eae..726e852 100644 --- a/platform/src/health_check.cpp +++ b/platform/src/health_check.cpp @@ -349,7 +349,7 @@ void health_check_session_init(const char *profile) MESA_load_profile_string_def(profile, "bfdd", "path", path, sizeof(path), "/var/run/frr/bfdd.vty"); MESA_load_profile_string_def(profile, "bfdd", "device", hc_dev_name, sizeof(hc_dev_name), "eth0"); MESA_load_profile_string_def(profile, "bfdd", "local_address", local_address, sizeof(local_address), "127.0.0.1"); - MESA_load_profile_string_def(profile, "bfdd", "gateway", gateway_address, sizeof(gateway_address), "127.0.0.1"); + MESA_load_profile_string_nodef(profile, "bfdd", "gateway", gateway_address, sizeof(gateway_address)); MESA_load_profile_string_def(profile, "bfdd", "default_gw_mac", default_gw_mac_str, sizeof(default_gw_mac_str), "aa:aa:aa:aa:aa:aa"); if (enable == 0) @@ -359,7 +359,9 @@ void health_check_session_init(const char *profile) } g_sf_status = sf_status_create(profile); - health_check_method_table_add(&g_handle_none, gateway_address); + if (strlen(gateway_address) > 0) { + health_check_method_table_add(&g_handle_none, gateway_address); + } health_check_session_foreach(); listen_arp_table(); send_icmp_cycle(); @@ -773,6 +775,12 @@ int health_check_session_get_mac(uint64_t session_id, u_char mac_buff[]) } if (memcmp(mac, init_mac, ETH_ALEN) == 0) { + if (strlen(gateway_address) == 0) { + LOG_DEBUG("health check session id [%lu] profile id [%d] health check method [%s] get mac [null]", session_id, tmp->profile_id, str_method); + pthread_rwlock_unlock(&g_handle.rwlock); + return -1; + } + health_check_method_table_get_mac(&g_handle_none, gateway_address, mac); if (memcmp(mac, init_mac, ETH_ALEN) == 0) { LOG_DEBUG("health check session id [%lu] profile id [%d] health check method [%s] get mac [null]", session_id, tmp->profile_id, str_method); |
