OpenVPN / OpenVPN/openvpn

Management port only allows one connection at a time

Open
#660 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature non-trivial change
Dominant language
C
Stars
14.6k
Forks
3.4k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
If two or more clients connect to the management port, only the first one will be served (i.e. only its commands will be listened for and responded to). Once that client closes the connection, the pending commands from the next client will be handled.

To Reproduce

  • Start openvpn with the management port enabled.
  • Start a telnet session in terminal A (telnet localhost 7505).
  • Afterwards, start another telnet session in terminal B.
  • Send commands in terminal A (e.g. help, status).
  • Send commands in terminal B.
  • Quit the telnet session in terminal A.

Expected behavior
The commands in both telnet session should be responded to. Instead, only commands in terminal A get responded to. Once the telnet instance in terminal A is closed, suddenly all commands send in terminal B get instantly answered.

Version information (please complete the following information):

  • OS: Ubuntu 22.04
  • OpenVPN version: 2.5.11

Additional context
The scenario of multiple concurrent clients of the management port can happen in several ways. Either one long running client similar to the OpenVPN GUI or a third-party management process block all other clients; or multiple shorter lived clients interfere and by chance connect at similar times. These could be management scripts (kick some client), monitoring (get the whole status), supervisor commands (reload etc).
Some of these clients (mostly monitoring) could instead use the status file though that is not always guaranteed to be up-to-date. (Furthermore looking at the code it looks like it is not atomically written so one may obtain an inconsistent/broken status file.)

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the management-port behavior with two telnet sessions on localhost:7505, then trace the management port's connection handling and command processing. Done means concurrent clients can send commands and receive responses without waiting for an earlier client to close.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.