FreeBSD, DCO and --user non-root
Open
@cron2 is already working on this.
Since May 20, 2025.
DCO
enhancement
FreeBSD
- Dominant language
- C
- Stars
- 14.6k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
Trying to run on FreeBSD with DCO enabled, and using --user nobody leads to
2025-05-20 09:57:00 DCO device tun7 opened
2025-05-20 09:57:00 ovpn-dco device [tun7] opened
...
2025-05-20 09:57:00 UID set to nobody
...
2025-05-20 09:57:00 Failed to poll for packets: Operation not permitted (errno=1)
2025-05-20 09:57:00 Failed to poll for packets: Operation not permitted (errno=1)
2025-05-20 09:57:16 Failed to poll for packets: Operation not permitted (errno=1)
2025-05-20 09:57:31 Failed to poll for packets: Operation not permitted (errno=1)
or, if the tun7 interface was precreated ("ifconfig tun7 create")
2025-05-20 09:57:59 Failed to create interface tun7 (SIOCSIFNAME): File exists (errno=17)
2025-05-20 09:57:59 dco_set_ifmode: failed to set ifmode=00008010: Invalid argument (errno=22)
2025-05-20 09:57:59 DCO device tun7 already exists, won't be destroyed at shutdown
2025-05-20 09:57:59 ovpn-dco device [tun7] opened
2025-05-20 09:57:59 /sbin/ifconfig tun7 10.194.2.250 10.194.2.249 mtu 1500 netmask 255.255.255.255 up
2025-05-20 09:57:59 /sbin/ifconfig tun7 inet6 fd00:abcd:194:2::103d/64 mtu 1500 up
2025-05-20 09:57:59 ../distro/dns-scripts/dns-updown
2025-05-20 09:57:59 dns up command exited with status 0
2025-05-20 09:57:59 /sbin/route add -net 10.194.0.0 10.194.2.249 255.255.0.0
add net 10.194.0.0: gateway 10.194.2.249
2025-05-20 09:57:59 /sbin/route add -net 10.194.2.1 10.194.2.249 255.255.255.255
add net 10.194.2.1: gateway 10.194.2.249
2025-05-20 09:57:59 Failed to create new peer: Invalid argument (errno=22)
2025-05-20 09:57:59 Exiting due to fatal error
... so "it just does not work". With --disable-dco it uses the tun/tap interface, which works.
So I think we need a check --user <nonroot> set? -> disable dco (for FreeBSD only, Linux DCO with capabilities works)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.