Signed-off-by: Arne Schwabe <a...@rfc2549.org>
---
 src/openvpn/forward.c |  3 ++-
 src/openvpn/openvpn.h | 12 +++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c
index 6f7a50048..98caf6651 100644
--- a/src/openvpn/forward.c
+++ b/src/openvpn/forward.c
@@ -1880,7 +1880,8 @@ io_wait_dowork(struct context *c, const unsigned int 
flags)
     unsigned int tuntap = 0;
     struct event_set_return esr[4];
 
-    /* These shifts all depend on EVENT_READ and EVENT_WRITE */
+    /* These shifts all depend on EVENT_READ (=1) and EVENT_WRITE (=2) */
+    /* and are added to the shift. */
     static int socket_shift = 0;   /* depends on SOCKET_READ and SOCKET_WRITE 
*/
     static int tun_shift = 2;      /* depends on TUN_READ and TUN_WRITE */
     static int err_shift = 4;      /* depends on ES_ERROR */
diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h
index 0ddaeb730..322ab3ee1 100644
--- a/src/openvpn/openvpn.h
+++ b/src/openvpn/openvpn.h
@@ -245,7 +245,17 @@ struct context_2
     int event_set_max;
     bool event_set_owned;
 
-    /* event flags returned by io_wait */
+    /* event flags returned by io_wait,
+     * All these event are their respective shift as defined in io_wait_dowork
+     * adding a shift of 0 for the READ event and 1 for the write event.
+     *
+     * E.g. management_shift = 6;
+     * MANAGMENT_READ = (1<<(6+0)),
+     * MANAGEMNET_WRITE = (1<<(6+1))
+     *
+     * Some shifts (error, file_close) are using read/write for diferent
+     * signals.
+     */
 #define SOCKET_READ       (1<<0)
 #define SOCKET_WRITE      (1<<1)
 #define TUN_READ          (1<<2)
-- 
2.30.1



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to