]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
dco_linux: avoid bogus text when netlink message is not parsed
authorAntonio Quartulli <antonio@mandelbit.com>
Fri, 23 May 2025 07:38:41 +0000 (09:38 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 23 May 2025 07:51:45 +0000 (09:51 +0200)
We may bail out parsing an incoming DCO message because it may
concern a different interface.
In that case we print the following debug messages:

    dco_do_read
    ovpn-dco: ignoring message (type=5) for foreign ifindex 313
    process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message
of type 0 being received, but the message_type was simply not
initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250523073848.20848-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31763.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c

index 022afdb929a329d3bffab4da4bee054e3f7c9749..a83b2582e7ac0fceb6995c6294ba08db941e0076 100644 (file)
@@ -1251,6 +1251,12 @@ process_incoming_dco(struct context *c)
 
     dco_do_read(dco);
 
+    /* no message for us to handle - platform specific code has logged details */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */