Skip to content

Commit

Permalink
Merge branch 'main' into libfuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
saxena-anurag authored May 27, 2022
2 parents 6dc7908 + 82db455 commit 1720a39
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions libs/platform/user/ebpf_extension_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ ebpf_extension_load(
}
local_extension_provider = *hash_table_find_result;

if (memcmp(interface_id, &local_extension_provider->interface_id, sizeof(GUID)) != 0) {
EBPF_LOG_MESSAGE_GUID(
EBPF_TRACELOG_LEVEL_ERROR, EBPF_TRACELOG_KEYWORD_BASE, "Wrong interface_id", *interface_id);
return_value = EBPF_INVALID_ARGUMENT;
goto Done;
}

return_value = ebpf_hash_table_update(
local_extension_provider->client_table,
(const uint8_t*)&local_extension_client->client_module_id,
Expand Down
10 changes: 8 additions & 2 deletions tests/performance/ExecutionContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ typedef class _ebpf_program_test_state
{
public:
_ebpf_program_test_state(std::vector<ebpf_instruction_t> byte_code)
: byte_code(byte_code), program_info_provider(EBPF_PROGRAM_TYPE_XDP)
: byte_code(byte_code), program_info_provider(nullptr)
{
ebpf_program_parameters_t parameters = {EBPF_PROGRAM_TYPE_XDP};
REQUIRE(ebpf_core_initiate() == EBPF_SUCCESS);

// Create the program info provider. We can only do this after calling
// ebpf_core_initiate() since that initializes the interface GUID.
program_info_provider = new _program_info_provider(EBPF_PROGRAM_TYPE_XDP);

REQUIRE(ebpf_program_create(&program) == EBPF_SUCCESS);

REQUIRE(ebpf_program_initialize(program, &parameters) == EBPF_SUCCESS);
}
~_ebpf_program_test_state()
{
ebpf_object_release_reference(reinterpret_cast<ebpf_core_object_t*>(program));
delete program_info_provider;
ebpf_core_terminate();
}

Expand Down Expand Up @@ -77,7 +83,7 @@ typedef class _ebpf_program_test_state
private:
ebpf_program_t* program;
std::vector<ebpf_instruction_t> byte_code;
_program_info_provider program_info_provider;
_program_info_provider* program_info_provider;
} ebpf_program_test_state_t;

typedef class _ebpf_map_test_state
Expand Down

0 comments on commit 1720a39

Please sign in to comment.