Skip to content
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

'getsockopt' isn't found in syscall on FreeBSD #29159

Closed
yurivict opened this issue Dec 8, 2018 · 2 comments
Closed

'getsockopt' isn't found in syscall on FreeBSD #29159

yurivict opened this issue Dec 8, 2018 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@yurivict
Copy link

yurivict commented Dec 8, 2018

The code that looks like this:

import (
        "errors"
        "net"
        "syscall"
        "unsafe"
)
...skipped...
        if err := getsockopt(fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz))); err != nil {
                return nil, err
        }

fails:

# github.com/Dreamacro/clash/proxy/redir
proxy/redir/tcp_freebsd.go:41:12: undefined: getsockopt

getsockopt is supposed to be found in syscall.

go-1.11

@agnivade
Copy link
Contributor

agnivade commented Dec 8, 2018

I think there is some confusion here. You are calling a private function. Can you show us a complete minimal code which reproduces this ? Your current version is a redacted snippet.

getsockopt is supposed to be found in syscall.

You say it is supposed to be in syscall, but you are not using the syscall library. Please show us the full code.

Are you looking for syscall.Syscall6 using syscall.SYS_GETSOCKOPT ?

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 8, 2018
@yurivict
Copy link
Author

yurivict commented Dec 8, 2018

syscall.Syscall6 using syscall.SYS_GETSOCKOPT worked, thanks!

@yurivict yurivict closed this as completed Dec 8, 2018
@golang golang locked and limited conversation to collaborators Dec 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants