On OpenBSD, rest-server only listens using IPv4/TCPv4

Open
#324 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go

Research direction

Start by locating rest-server's listener setup and reviewing the linked Go net package notes alongside OpenBSD's inet6(4) behavior. Done means the server accepts connections over both IPv4 and IPv6 on OpenBSD, with tests or a reproducible verification covering the dual-stack behavior.

Written by the indexing model from the issue text.

Description

Output of rest-server --version

rest-server version rest-server 0.13.0 compiled with go1.23.1 on openbsd/amd64

What should rest-server do differently?

On OpenBSD, due to an underlying Go limitation, the rest-server only listens for connections via IPv4/TCPv4. For folks running a dual stack network it would be nice if rest-server could support listening on both IPv4 and IPv6.

More details available here: golang net documentation - Notes

On DragonFly BSD and OpenBSD, listening on the "tcp" and "udp" networks does not listen for both IPv4 and IPv6 connections. This is due to the fact that IPv4 traffic will not be routed to an IPv6 socket - two separate sockets are required if both address families are to be supported. See inet6(4) for details.

The OpenBSD inet6(4) manual page:

For security reasons, OpenBSD does not route IPv4 traffic to an AF_INET6 socket, and does not support IPv4 mapped addresses, where IPv4 traffic is seen as if it comes from an IPv6 address like “::ffff:10.1.1.1”. Where both IPv4 and IPv6 traffic need to be accepted, bind and listen on two sockets.

What are you trying to do? What is your use case?

Connect to the rest-server using IPv6.

Did rest-server help you today? Did it make you happy in any way?

I use rest-server for all my home network backup needs, its great!

Dominant language
Go
Stars
1.5k
Forks
178
Avg merge
15d 9h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from restic/rest-server

All issues in restic/rest-server

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.