kni对fd异常判空。
This commit is contained in:
@@ -522,7 +522,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo
|
|||||||
MESA_load_profile_uint_def(profile, section, "cert_store_port", &(keeper->cert_store_port), 80);
|
MESA_load_profile_uint_def(profile, section, "cert_store_port", &(keeper->cert_store_port), 80);
|
||||||
MESA_load_profile_uint_def(profile, section, "hash_slot_size", &(keeper->hash_slot_size), 1024*128);
|
MESA_load_profile_uint_def(profile, section, "hash_slot_size", &(keeper->hash_slot_size), 1024*128);
|
||||||
MESA_load_profile_uint_def(profile, section, "hash_expire_seconds", &(keeper->hash_expire_seconds), 5*60);
|
MESA_load_profile_uint_def(profile, section, "hash_expire_seconds", &(keeper->hash_expire_seconds), 5*60);
|
||||||
MESA_load_profile_uint_def(profile, section, "no_local_cache", &(keeper->no_cache), 0);
|
MESA_load_profile_uint_def(profile, section, "no_cache", &(keeper->no_cache), 0);
|
||||||
|
|
||||||
keeper->cert_cache = create_hash_table(keeper->hash_slot_size, keeper->hash_expire_seconds);
|
keeper->cert_cache = create_hash_table(keeper->hash_slot_size, keeper->hash_expire_seconds);
|
||||||
if(0==strcmp(keeper->untrusted_ca_path, keeper->trusted_ca_path))
|
if(0==strcmp(keeper->untrusted_ca_path, keeper->trusted_ca_path))
|
||||||
@@ -546,8 +546,8 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo
|
|||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TFE_LOG_INFO(logger, "MESA_load_profile, [%s]: mode:%s, ca_path:%s, untrusted_ca_path:%s, cert_store_host:%s, cert_store_port:%d, hash_slot_size:%d, hash_expire_seconds:%d",
|
TFE_LOG_INFO(logger, "MESA_load_profile, [%s]: mode:%s, no_cache:%u ,ca_path:%s, untrusted_ca_path:%s, cert_store_host:%s, cert_store_port:%d, hash_slot_size:%d, hash_expire_seconds:%d",
|
||||||
section, tmp, keeper->trusted_ca_path, keeper->untrusted_ca_path, keeper->cert_store_host, keeper->cert_store_port, keeper->hash_slot_size, keeper->hash_expire_seconds);
|
section, tmp, keeper->no_cache, keeper->trusted_ca_path, keeper->untrusted_ca_path, keeper->cert_store_host, keeper->cert_store_port, keeper->hash_slot_size, keeper->hash_expire_seconds);
|
||||||
|
|
||||||
return keeper;
|
return keeper;
|
||||||
|
|
||||||
|
|||||||
@@ -251,6 +251,12 @@ void __kni_event_cb(evutil_socket_t fd, short what, void * user)
|
|||||||
__cmsghdr = CMSG_FIRSTHDR(&__msghdr);
|
__cmsghdr = CMSG_FIRSTHDR(&__msghdr);
|
||||||
__fds = (int *) (CMSG_DATA(__cmsghdr));
|
__fds = (int *) (CMSG_DATA(__cmsghdr));
|
||||||
|
|
||||||
|
if (unlikely(__cmsghdr == NULL))
|
||||||
|
{
|
||||||
|
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_FIRSTHDR() from incoming fds, close KNI connection.");
|
||||||
|
goto __close_kni_connection;
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely(__fds == NULL))
|
if (unlikely(__fds == NULL))
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_DATA() from incoming fds, close KNI connection.");
|
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_DATA() from incoming fds, close KNI connection.");
|
||||||
|
|||||||
Reference in New Issue
Block a user