Skip to content

Commit

Permalink
PR Feedback 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
shankarseal committed Apr 5, 2022
1 parent f62f160 commit 0805949
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/ebpf_program_attach_type_guids.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern "C"

/** @brief The programs attached to the INETx_CONNECT hook will be invoked for
* connect() calls on TCP or UDP sockets or when a UDP socket calls sendto() to
* a unique remote address/port tuple. May be scoped to a network compartment. The programs return 0 to permit the
* connection, and a negative integer to block them.
* a unique remote address/port tuple. May be scoped to a network compartment. The programs return 1 to permit a
* connection, and 0 to block it.
*/
__declspec(selectany) ebpf_attach_type_t EBPF_ATTACH_TYPE_CGROUP_INET4_CONNECT = {
0xa82e37b1, 0xaee7, 0x11ec, {0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee}};
Expand All @@ -45,7 +45,7 @@ extern "C"
/** @brief The programs attached to the INETx_RECV_ACCEPT hook will get invoked for
* TCP accept() calls or for the first unicast UDP packet from a unique remote
* address/port tuple. May be scoped to a network compartment. The programs return 1 to permit a connection, and
* a 0 to block it.
* 0 to block it.
*/
__declspec(selectany) ebpf_attach_type_t EBPF_ATTACH_TYPE_CGROUP_INET4_RECV_ACCEPT = {
0xa82e37b3, 0xaee7, 0x11ec, {0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee}};
Expand Down
1 change: 0 additions & 1 deletion netebpfext/net_ebpf_ext_hook_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ net_ebpf_extension_hook_client_set_provider_data(_In_ net_ebpf_extension_hook_cl
* @brief Get the hook-specific provider data for the attached client.
*
* @param[in] hook_client Pointer to attached hook NPI client.
* @param[in] data hook-specific provider data.
*
* @returns Pointer to hook-specific provider data for the attached client.
*/
Expand Down
2 changes: 1 addition & 1 deletion netebpfext/net_ebpf_ext_sock_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ net_ebpf_extension_sock_addr_on_client_attach(
compartment_id = *(uint32_t*)client_data->data;

// Set compartment id (if not UNSPECIFIED_COMPARTMENT_ID) as WFP filter condition.
if (compartment_id != 0) {
if (compartment_id != UNSPECIFIED_COMPARTMENT_ID) {
condition.fieldKey = FWPM_CONDITION_COMPARTMENT_ID;
condition.matchType = FWP_MATCH_EQUAL;
condition.conditionValue.type = FWP_UINT32;
Expand Down

0 comments on commit 0805949

Please sign in to comment.