kni对fd异常判空。

This commit is contained in:
zhengchao
2018-11-26 12:05:18 +08:00
parent 089499bdd5
commit 35c2559f8a
2 changed files with 9 additions and 3 deletions

View File

@@ -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;

View File

@@ -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.");