Skip to content

Conversation

@efd6
Copy link
Collaborator

@efd6 efd6 commented Nov 22, 2021

Please take a look.

Depends #2.

efd6 and others added 2 commits November 22, 2021 11:05
afpacket uses syscalls unix.SYS_GETSOCKOPT and unix.SYS_SETSOCKOPT
when it needs to call [gs]etsockopt() passing a raw pointer. This
doesn't work for 32-bit x86 platforms as there's no such syscall,
resulting in:

   setsockopt packet_rx_ring: function not implemented

   unix.Syscall(unix.SYS_GETSOCKOPT[=366],...) = 38 // ENOSYS

The correct way to call [gs]etsockopt() in this platform is to use
the SYS_SOCKETCALL syscall with the right call parameter.

This patch refactors the raw [gs]etsockopt() calls in afpacket to use
unix.GetsockoptString and unix.SetsockoptString so that it relies on
Go runtime to call the appropriate syscall.
@efd6 efd6 merged commit 3169e3e into beats Dec 2, 2021
@efd6 efd6 deleted the beats-adriansr-i386 branch December 2, 2021 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants