This commit is contained in:
saxena-anurag 2022-04-19 13:06:54 -07:00 коммит произвёл GitHub
Родитель 17379737cf
Коммит 56d2bd377f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -220,7 +220,10 @@ ebpf_map_create(
map_definition.value_size = value_size;
map_definition.max_entries = max_entries;
inner_map_handle = (opts) ? _get_handle_from_file_descriptor(opts->inner_map_fd) : ebpf_handle_invalid;
// bpf_map_create_opts has inner_map_fd defined as __u32, so it cannot be set to
// ebpf_fd_invalid (-1). Hence treat inner_map_fd = 0 as ebpf_fd_invalid.
inner_map_handle = (opts && opts->inner_map_fd != 0) ? _get_handle_from_file_descriptor(opts->inner_map_fd)
: ebpf_handle_invalid;
result = _create_map(map_name, &map_definition, inner_map_handle, &map_handle);
if (result != EBPF_SUCCESS) {

Просмотреть файл

@ -262,10 +262,9 @@ _create_array_map(
ebpf_handle_t inner_map_handle,
_Outptr_ ebpf_core_map_t** map)
{
// Temporarily removing check for inner map handle until
// https://github.com/microsoft/ebpf-for-windows/issues/739 is fixed.
UNREFERENCED_PARAMETER(inner_map_handle);
if (inner_map_handle != ebpf_handle_invalid) {
return EBPF_INVALID_ARGUMENT;
}
return _create_array_map_with_map_struct_size(sizeof(ebpf_core_map_t), map_definition, map);
}