-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall: missing SYS_GETSOCKOPT in zsysnum_linux_386.go #19043
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
Comments
working as intended because there isn't a getsockopt syscall on linux/386.
Long answer:
linux/386 multiplexes all socket syscalls into a one syscall (probably
because there aren't enough registers to pass the arguments.)
https://golang.org/src/syscall/syscall_linux_386.go#L183
|
Thanks a lot for the explanation. In that case, how to implement // Call getorigdst() from linux/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
func getorigdst(fd uintptr) (*syscall.RawSockaddrInet4, error) {
const SO_ORIGINAL_DST = 80 // from linux/include/uapi/linux/netfilter_ipv4.h
raw := syscall.RawSockaddrInet4{}
siz := unsafe.Sizeof(raw)
if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz)), 0); errno != 0 {
return nil, errno
}
return raw, nil
} |
Questions are best directed to a forum, rather than the issue tracker; see https://golang.org/wiki/Questions. On 386 GNU/Linux you'll need to call something along the lines of |
Thanks a lot for the pointer! :) |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.7.5
What operating system and processor architecture are you using (
go env
)?Darwin/amd64
What did you do?
If possible, provide a recipe for reproducing the error.
What did you expect to see?
List of defined constants containing SYS_GETSOCKOPT.
What did you see instead?
The text was updated successfully, but these errors were encountered: