DCO servers do not handle full --ifconfig-pool gracefully
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.6k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
TCP servers do not properly expire clients, so the pool fills, and when the pool is full, clients can no longer connect and the syslog is full of "DCO errors"
To Reproduce
run a TCP server, connect a few 10.000 clients with different usernames (=new IP address assignment per client), disconnect right away
Expected behavior
dco-linux needs to inform userland about closed TCP sessions, but until this can be done, userland should log this in a more useful way (see below)
Version information (please complete the following information):
- OS: Ubuntu 20.04
- OpenVPN version: master + bandaid patch, as of Dec 22, 2022
Additional context
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: 2001:608:0:814::f000:21 [gremlin46393] Peer Connection Initiated with [AF_INET6]2001:608:0:814::f000:21:24792
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 MULTI: no free --ifconfig-pool addresses are available
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 MULTI: no dynamic or static remote--ifconfig address is available for gremlin46393/2001:608:0:814::f000:21
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 dco_new_peer: peer-id 0, fd 9, remote addr: [undefined]
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 dco_new_peer: netlink reports error (-7): Invalid input data or parameter: No such file or directory (errno=2)
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 dco_new_peer: failed to send netlink message: Invalid argument (-22)
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 Cannot add peer to DCO for gremlin46393/2001:608:0:814::f000:21: Invalid argument (-22)
Dec 22 12:01:36 ubuntu2004 tun-tcp-p2mp-username-cn[1659541]: gremlin46393/2001:608:0:814::f000:21 Delayed exit in 5 seconds
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.
Research direction
Start by reproducing the TCP server case with many clients using different usernames and inspect how dco-linux and userland handle closed sessions and --ifconfig-pool exhaustion. Done should mean disconnected clients no longer leave the pool full, and a full pool does not produce the repeated DCO errors shown in the logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100