]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Reduce logspam about 'dco_update_keys: peer_id=-1' in p2p server mode
authorGert Doering <gert@greenie.muc.de>
Mon, 9 Jan 2023 20:00:11 +0000 (21:00 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 10 Jan 2023 14:03:13 +0000 (15:03 +0100)
p2p --tls-server with no active client/peer logs once per second

  "dco_update_keys: peer_id=-1"

which does exactly nothing, except fill the disk.  So skip the call to
dco_update_keys() if peer_id == -1.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20230109200011.2525342-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25935.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c

index f44f473f60d2c0790cfab0447ec63c598421b098..53f7525c829906fa8c0decee44f453584e084fd6 100644 (file)
@@ -151,6 +151,12 @@ check_dco_key_status(struct context *c)
         return;
     }
 
+    /* no active peer (p2p tls-server mode) */
+    if (c->c2.tls_multi->dco_peer_id == -1)
+    {
+        return;
+    }
+
     if (!dco_update_keys(&c->c1.tuntap->dco, c->c2.tls_multi))
     {
         /* Something bad happened. Kill the connection to