]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
mudp.c, multi.c, multi_io.c: get rid of 'all three DCO platforms' #ifdefs
authorGert Doering <gert@greenie.muc.de>
Mon, 28 Jul 2025 08:42:49 +0000 (10:42 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 28 Jul 2025 10:24:13 +0000 (12:24 +0200)
With commit b66b80b2a all three platforms with DCO support have DCO float
notifications now, so the #ifdef inside multi_process_incoming_dco() is
no longer needed.

Also, the whole notification block (process_incoming_del_peer() and
multi_process_incoming_dco()) was surrounded by an

  #ifdef ENABLE_DCO "and all 3 platforms"

which is also not making sense anymore (if we add a fourth DCO platform,
we need to aim for having "all notifications from day 1", at least having
the stubs and defines).

Last not least, the event stuff in mudp.c and multi_io.c had grown the
same construct - and we'll need events for any future DCO platform, too.

So, fix those #ifdef as well, while at it.

Change-Id: I6977d23b5289eba5db436608e0500216e0e689ec
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Message-Id: <20250728084255.1824-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32377.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/mudp.c
src/openvpn/multi.c
src/openvpn/multi_io.c

index ee8446a2a502205affb07978440cb447527947e1..118c954a4641b1ad959877e8f024d539b3db76a7 100644 (file)
@@ -412,8 +412,7 @@ multi_process_io_udp(struct multi_context *m, struct link_socket *sock)
         multi_process_file_closed(m, mpp_flags);
     }
 #endif
-#if defined(ENABLE_DCO) \
-    && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
     else if (status & DCO_READ)
     {
         if (!IS_SIG(&m->top))
index 49f5320114d7ea919b60bd29f863cf511efb03a0..b2d2b6ce6a2596d95ef0ef3f9419283e6bd883a3 100644 (file)
@@ -3337,8 +3337,7 @@ multi_signal_instance(struct multi_context *m, struct multi_instance *mi, const
 }
 #endif
 
-#if defined(ENABLE_DCO) \
-    && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
 static void
 process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi,
                           dco_context_t *dco)
@@ -3409,7 +3408,6 @@ multi_process_incoming_dco(struct multi_context *m)
         {
             process_incoming_del_peer(m, mi, dco);
         }
-#if defined(TARGET_LINUX) || defined(TARGET_WIN32) || defined(TARGET_FREEBSD)
         else if (dco->dco_message_type == OVPN_CMD_FLOAT_PEER)
         {
             ASSERT(mi->context.c2.link_sockets[0]);
@@ -3419,7 +3417,6 @@ multi_process_incoming_dco(struct multi_context *m)
             multi_process_float(m, mi, mi->context.c2.link_sockets[0]);
             CLEAR(dco->dco_float_peer_ss);
         }
-#endif /* if defined(TARGET_LINUX) || defined(TARGET_WIN32) */
         else if (dco->dco_message_type == OVPN_CMD_SWAP_KEYS)
         {
             tls_session_soft_reset(mi->context.c2.tls_multi);
@@ -3452,7 +3449,7 @@ multi_process_incoming_dco(struct multi_context *m)
     dco->dco_write_bytes = 0;
     return ret > 0;
 }
-#endif /* if defined(ENABLE_DCO) && defined(TARGET_LINUX) */
+#endif /* if defined(ENABLE_DCO) */
 
 /*
  * Process packets in the TCP/UDP socket -> TUN/TAP interface direction,
index 4854f4b969c5ab660379433f3c0902eb7138c8ad..102ee2f638762cd0feb4c34e6d3795a63936fc1f 100644 (file)
@@ -191,8 +191,7 @@ multi_io_wait(struct multi_context *m)
     }
 
     tun_set(m->top.c1.tuntap, m->multi_io->es, EVENT_READ, MULTI_IO_TUN, persistent);
-#if defined(ENABLE_DCO) \
-    && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
     dco_event_set(&m->top.c1.tuntap->dco, m->multi_io->es, MULTI_IO_DCO);
 #endif
 
@@ -526,8 +525,7 @@ multi_io_process_io(struct multi_context *m)
                     multi_io_action(m, mi, TA_INITIAL, false);
                 }
             }
-#if defined(ENABLE_DCO) \
-            && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
             /* incoming data on DCO? */
             else if (e->arg == MULTI_IO_DCO)
             {