Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1956?usp=email

to review the following change.


Change subject: dco: refresh peer stats before userspace disconnect
......................................................................

dco: refresh peer stats before userspace disconnect

When userspace initiates a client disconnect, the DCO peer still exists
when multi_close_instance starts. Query its stats before removing the
instance from the peer-id lookup table, so that the reply can update the
disconnect environment.

Kernel-initiated deletions reset dco_peer_id before closing the instance
and may provide final stats in their deletion notification. Only query
established peers with a valid dco_peer_id to avoid asking the kernel
about a peer that is already gone.

Change-Id: Iacbba3dabd8049901212adaf7551abc554b00226
Signed-off-by: Ralf Lici <[email protected]>
---
M src/openvpn/multi.c
1 file changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/1956/1

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 9b9cdc3..d23abbb 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -590,6 +590,18 @@
         }
 #endif
 
+        /* This path handles both kernel-reported and userspace-initiated peer
+         * deletion. In the former case, the peer is already gone and
+         * dco_peer_id has been reset to -1. Only query stats while it is still
+         * valid.
+         */
+        if (mi->context.c2.tls_multi->multi_state >= CAS_CONNECT_DONE
+            && dco_enabled(&mi->context.options)
+            && mi->context.c2.tls_multi->dco_peer_id != -1)
+        {
+            dco_get_peer_stats(&mi->context, false);
+        }
+
         if (mi->context.c2.tls_multi->rx_peer_id != MAX_PEER_ID)
         {
             m->instances[mi->context.c2.tls_multi->rx_peer_id] = NULL;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1956?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iacbba3dabd8049901212adaf7551abc554b00226
Gerrit-Change-Number: 1956
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to