-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Return better error codes from hooked syscalls
When a syscall is rejected in BPF, by default the error code returned is -EPERM. Set more appropriate codes explicitly in the remaining places. The new error codes are chosen according to the documented possible return values of connect() and bind() syscalls in their corresponding man pages. When there is no health service to connect, ECONNREFUSED is returned. When map_update_elem returns an error (should only happen if max_entries is exceeded), ENOBUFS is returned, which is the closest error from the man page that indicates some internal error of the implementation: `Insufficient resources were available to complete the call`. Signed-off-by: Maxim Mikityanskiy <maxim@isovalent.com>
- Loading branch information
1 parent
274614f
commit 47eae08
Showing
2 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters