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

tsnet: improve ergonomics for listening for UDP packets #12182

Open
willnorris opened this issue May 18, 2024 · 0 comments
Open

tsnet: improve ergonomics for listening for UDP packets #12182

willnorris opened this issue May 18, 2024 · 0 comments
Assignees

Comments

@willnorris
Copy link
Member

A tsnet.Server can be configured to receive UDP packets, but that's not immediately obvious looking at the API. We should make this easier, perhaps by adding a ListenPacket receiver in the style of net.ListenPacket?

@maisem maisem changed the title improve ergonomics for tsnet and UDP tsnet: improve ergonomics for listening for UDP packets May 18, 2024
maisem added a commit that referenced this issue May 18, 2024
Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue May 18, 2024
Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue May 18, 2024
Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue May 18, 2024
Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue May 20, 2024
Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 1, 2024
This adds a new ListenPacket function on tsnet.Server
which acts mostly like `net.ListenPacket`.

Unlike `Server.Listen`, this requires listening on a
specific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.

To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 1, 2024
This adds a new ListenPacket function on tsnet.Server
which acts mostly like `net.ListenPacket`.

Unlike `Server.Listen`, this requires listening on a
specific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.

To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 2, 2024
This adds a new ListenPacket function on tsnet.Server
which acts mostly like `net.ListenPacket`.

Unlike `Server.Listen`, this requires listening on a
specific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.

To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 2, 2024
This adds a new ListenPacket function on tsnet.Server
which acts mostly like `net.ListenPacket`.

Unlike `Server.Listen`, this requires listening on a
specific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.

To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 2, 2024
This adds a new ListenPacket function on tsnet.Server
which acts mostly like `net.ListenPacket`.

Unlike `Server.Listen`, this requires listening on a
specific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.

To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
creachadair added a commit that referenced this issue Jun 3, 2024
The internal helper returns a nil *listener, which is safe because we only do
so on error -- however it irks static analysis tools like staticcheck.

Updates #12182

Change-Id: If445e71a254263afbea60c7da26f906ffe73cd80
maisem added a commit that referenced this issue Jun 3, 2024
A `*listener` implements net.Listener which breaks
a test in another repo.

Regressed in 42cfbf4.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
maisem added a commit that referenced this issue Jun 3, 2024
A `*listener` implements net.Listener which breaks
a test in another repo.

Regressed in 42cfbf4.

Updates #12182

Signed-off-by: Maisem Ali <maisem@tailscale.com>
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

No branches or pull requests

2 participants