DCO client doesn't answer management `status` while reconnecting

Abierto Apto para principiantes
#1,146 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
71/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

Empieza con print_status() y su llamada a dco_get_peer_stats(); la incidencia señala el retorno anticipado que deja sin terminar la respuesta de gestión status cuando falla la obtención de las estadísticas del par DCO durante la reconexión. Sigue cómo print_status() escribe las líneas de estado y el END final; después, revisa las pruebas pertinentes de estado y DCO. El trabajo estará terminado cuando status finalice con END durante la reconexión y conserve los últimos contadores conocidos cuando el par DCO ya no esté disponible.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C
Estrellas
14.8k
Forks
3.4k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenVPN/openvpn

Todos los issues de OpenVPN/openvpn

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.