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

net: support Linux vsock sockets #69769

Open
waldiTM opened this issue Oct 3, 2024 · 3 comments
Open

net: support Linux vsock sockets #69769

waldiTM opened this issue Oct 3, 2024 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@waldiTM
Copy link

waldiTM commented Oct 3, 2024

Proposal Details

There exists basic support for AF_VSOCK sockets implemented in #19434.

Could support for such sockets please be added to the net module? For example net.FileListener can operate on TCP and UNIX sockets, but fails on vsock sockets.

@gopherbot gopherbot added this to the Proposal milestone Oct 3, 2024
@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Oct 3, 2024
@ianlancetaylor
Copy link
Contributor

What API would need to be added to the net package? Thanks.

@waldiTM
Copy link
Author

waldiTM commented Oct 3, 2024

Sorry, I can't answer this. I don't know enough about how this should work.

I see separate implementations of sockaddr structs in syscall and x/sys/unix. So I assume right now, it would need the ones from syscall?

This means:

  • src/syscall/types_linux.go: map struct sockaddr_vm to RawSockaddrVM
  • src/syscall/syscall_unix.go (or _linux.go?): add SockaddrVM struct
  • src/syscall/syscall_linux.go: implement AF_VSOCK support in anyToSockaddr function.
  • src/net/file_unix.go: implement support in newFileFD and fileListener
  • src/net/vmlistener.go: implement a separate listener for vsock connection

Problem I see: vsock is linux specific, the net package code is unix specific.

@ianlancetaylor
Copy link
Contributor

Thanks. The way the proposal process is intended to work is that people work out the details of how the libraries should change and open a proposal for that. It doesn't work to ask us to figure things out--we don't know what you need. I'm going to take this out of the proposal process. Perhaps interested parties can work out the API changes, and then we can open a proposal for that.

@ianlancetaylor ianlancetaylor changed the title proposal: net: support Linux vsock sockets net: support Linux vsock sockets Oct 3, 2024
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed Proposal labels Oct 3, 2024
@ianlancetaylor ianlancetaylor modified the milestones: Proposal, Unplanned Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants