Skip to content

DCO client doesn't answer management status while reconnecting #1146

Done

Description

@Tbaile

Describe the bug
With DCO enabled, after a ping-restart the client stops answering the status command on the management interface until the tunnel is back up. The command gets read but nothing comes back, not even END. Since management serves one client at a time, whoever asked for the status locks both the request and all the subsequent ones, even the --status file.
Seems to come from print_status(), which returns early if dco_get_peer_stats() fails:

if (dco_get_peer_stats(c, true) < 0)
{
    return;
}

During the reconnect there's no DCO interface, so the call fails and nothing gets printed.

To Reproduce

  • Client with DCO and a management socket (management /var/run/openvpn.sock unix)
  • Connect it to a server, then stop the server
  • After the ping-restart, send status on the socket: printf 'status\n' | socat - UNIX-CONNECT:/var/run/openvpn.sock
  • Only the greeting comes back

Disabling the DCO solves the issue and responses from the management sockets are fine.

Expected behavior

status always answers and ends with END, with the last known counters if the DCO peer is gone.

Version information (please complete the following information):

  • OS: OpenWrt 25.12, kernel 6.12 with ovpn-backports
  • OpenVPN version: 2.7.7
  • Peer: 2.7.7 with DCO

Additional context

A possible fix could be removing the if condition entirely, and make return dco_get_peer_stats(c, true);, at the moment I'm running this patch and seems to work fine. On a read DCO error SIGUSR1 is still reported fine so session restarts are still signaled and taken care of.

I can send the patch to the list or Gerrit if it's fine.

Activity

  1. ordex commented on Nov 16, 2026

    @ordex
    Member

    I can send the patch to the list or Gerrit if it's fine.

    Please, feel free to send it. Gerrit works best.
    Thanks!

  2. Tbaile commented on Nov 16, 2026

    @Tbaile
    ContributorAuthor
  3. ordex commented on Nov 16, 2026

    @ordex
    Member

    @Tbaile I reviewed your patch and I actually found another issue in the same scenario.
    I have created a patch for that problem too: https://gerrit.openvpn.net/c/openvpn/+/2204
    Feel free to test/review if you feel like.

  4. Tbaile commented on Nov 16, 2026

    @Tbaile
    ContributorAuthor

    Will compile it first thing in the morning, anything to test for the linux side in particular?

  5. ordex commented on Nov 16, 2026

    @ordex
    Member

    Will compile it first thing in the morning, anything to test for the linux side in particular?

    same test you did for this patch (issue status during reconnect) but with --persist-tun in the client config.
    The patch carries a potential one line bash command aimed at triggering this.
    In theory the client should crash without the patch.

  6. Tbaile commented on Nov 17, 2026

    @Tbaile
    ContributorAuthor

    Both issues seems to be fixed by applying both of the patches. We don't use the --persist-tun but after adding it the daemon crashed as you noticed, with the patch it closed correctly all the times

    Thanks for your time!

  7. ordex commented on Nov 17, 2026

    @ordex
    Member

    Thank for testing @Tbaile ! Feel free to comment on Gerrit with your results.

  8. Tbaile commented on Nov 17, 2026

    @Tbaile
    ContributorAuthor

    Commented your patch with the linux findings, probably messed up since not knowing Gerrit that much 😅

  9. ordex commented on Nov 17, 2026

    @ordex
    Member

    Commented your patch with the linux findings, probably messed up since not knowing Gerrit that much 😅

    looks good, thanks!

  10. added a commit that references this issue on Nov 30, 2026
    44ed1e1
  11. added a commit that references this issue on Nov 30, 2026
    6b868cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions