@@ -3766,27 +3766,6 @@
}
/*
- * Drop a TUN/TAP outgoing packet..
- */
-void
-multi_process_drop_outgoing_tun(struct multi_context *m, const unsigned int mpp_flags)
-{
- struct multi_instance *mi = m->pending;
-
- ASSERT(mi);
-
- set_prefix(mi);
-
- msg(D_MULTI_ERRORS, "MULTI: Outgoing TUN queue full, dropped packet len=%d",
- mi->context.c2.to_tun.len);
-
- buf_reset(&mi->context.c2.to_tun);
-
- multi_process_post(m, mi, mpp_flags);
- clear_prefix();
-}
-
-/*
* Per-client route quota management
*/
@@ -295,7 +295,7 @@
* function controls the necessary postprocessing. It is called by many
* other functions that handle VPN tunnel related activity, such as \c
* multi_process_incoming_link(), \c multi_process_outgoing_link(), \c
- * multi_process_incoming_tun(), \c multi_process_outgoing_tun(), and \c
+ * multi_process_incoming_tun(), \c multi_io_write_tun(), and \c
* multi_process_timeout(), among others.
*
* @param m - The single \c multi_context structure.
@@ -364,8 +364,6 @@
bool multi_process_incoming_tun(struct multi_context *m, const unsigned int mpp_flags);
-void multi_process_drop_outgoing_tun(struct multi_context *m, const unsigned int mpp_flags);
-
struct multi_instance *multi_get_queue(struct mbuf_set *ms);
void multi_ifconfig_pool_persist(struct multi_context *m, bool force);
@@ -627,41 +625,6 @@
}
-/**
- * Send a packet over the virtual tun/tap network interface to its locally
- * reachable destination.
- * @ingroup internal_multiplexer
- *
- * This function calls \c process_outgoing_tun() to perform the actual
- * sending of the packet. Afterwards, it calls \c multi_process_post() to
- * perform server-mode postprocessing.
- *
- * @param m - The single \c multi_context structure.
- * @param mpp_flags - Fast I/O optimization flags.
- *
- * @return
- * - True, if the \c multi_instance associated with the packet sent was
- * not closed due to a signal during processing.
- * - Falls, if the \c multi_instance was closed.
- */
-static inline bool
-multi_process_outgoing_tun(struct multi_context *m, const unsigned int mpp_flags)
-{
- struct multi_instance *mi = m->pending;
- bool ret = true;
-
- ASSERT(mi);
-#ifdef MULTI_DEBUG_EVENT_LOOP
- printf("%s -> TUN len=%d\n", id(mi), mi->context.c2.to_tun.len);
-#endif
- set_prefix(mi);
- vlan_process_outgoing_tun(m, mi);
- process_outgoing_tun(&mi->context, mi->context.c2.link_sockets[0]);
- ret = multi_process_post(m, mi, mpp_flags);
- clear_prefix();
- return ret;
-}
-
#define CLIENT_CONNECT_OPT_MASK \
(OPT_P_INSTANCE | OPT_P_INHERIT | OPT_P_PUSH | OPT_P_TIMER | OPT_P_CONFIG | OPT_P_ECHO \
| OPT_P_COMP | OPT_P_SOCKFLAGS)
@@ -290,6 +290,62 @@
}
}
+/**
+ * Send a packet over the virtual tun/tap network interface to its locally
+ * reachable destination.
+ * @ingroup internal_multiplexer
+ *
+ * This function calls \c process_outgoing_tun() to perform the actual
+ * sending of the packet. Afterwards, it calls \c multi_process_post() to
+ * perform server-mode postprocessing.
+ *
+ * @param m - The single \c multi_context structure.
+ * @param mpp_flags - Fast I/O optimization flags.
+ *
+ * @return
+ * - True, if the \c multi_instance associated with the packet sent was
+ * not closed due to a signal during processing.
+ * - Falls, if the \c multi_instance was closed.
+ */
+static bool
+multi_io_write_tun(struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = m->pending;
+ bool ret = true;
+
+ ASSERT(mi);
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf("%s -> TUN len=%d\n", id(mi), mi->context.c2.to_tun.len);
+#endif
+ set_prefix(mi);
+ vlan_process_outgoing_tun(m, mi);
+ process_outgoing_tun(&mi->context, mi->context.c2.link_sockets[0]);
+ ret = multi_process_post(m, mi, mpp_flags);
+ clear_prefix();
+ return ret;
+}
+
+/*
+ * Drop a TUN/TAP outgoing packet..
+ */
+static void
+multi_io_drop_tun(struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = m->pending;
+
+ ASSERT(mi);
+
+ set_prefix(mi);
+
+ msg(D_MULTI_ERRORS, "MULTI: Outgoing TUN queue full, dropped packet len=%d",
+ mi->context.c2.to_tun.len);
+
+ buf_reset(&mi->context.c2.to_tun);
+
+ multi_process_post(m, mi, mpp_flags);
+ clear_prefix();
+}
+
static struct multi_instance *
multi_io_dispatch(struct multi_context *m, struct multi_instance *mi, const int action)
{
@@ -334,11 +390,11 @@
break;
case TA_TUN_WRITE:
- multi_process_outgoing_tun(m, mpp_flags);
+ multi_io_write_tun(m, mpp_flags);
break;
case TA_TUN_WRITE_TIMEOUT:
- multi_process_drop_outgoing_tun(m, mpp_flags);
+ multi_io_drop_tun(m, mpp_flags);
break;
case TA_SOCKET_WRITE_READY: