-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
afpacket: Fix support for 32-bit x86 arch #720
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
@googlebot I signed it! |
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.
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@notti can I get a review? Sorry for the ping :) |
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720 (cherry picked from commit 002b9c5)
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720 (cherry picked from commit 002b9c5)
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720 (cherry picked from commit 002b9c5)
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720 (cherry picked from commit 002b9c5)
This replaces github.com/google/gopacket with github.com/adriansr/gopacket which includes a fix to make af_packet work on 32bit x86. This patched version was already vendored but lost during the migration to Go modules. This patch is on review at google/gopacket#720 (cherry picked from commit 7a65724)
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:
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.