diff options
author | TDivine <tdivine@pcausa.com> | 2014-10-22 10:07:39 +0300 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2014-10-24 20:34:25 +0200 |
commit | 7aa178381241ae015273914065471e0d271ee1c3 (patch) | |
tree | 29b6f9b5ef987d049601de268b6bfc64a8b94e2d | |
parent | 7da9d40243e0743e2d050ceb6ae34e467dd58973 (diff) | |
download | openvpn-7aa178381241ae015273914065471e0d271ee1c3.tar.gz openvpn-7aa178381241ae015273914065471e0d271ee1c3.tar.xz openvpn-7aa178381241ae015273914065471e0d271ee1c3.zip |
Fix "code=995" bug with windows NDIS6 tap driver.
Modification to address bug where OpenVPN enters state where it is
unresponsive and cannot be terminated. Log output is continuous spew
of "code=995" errors.
Revised fix for code=995 sped bug.
Adding new tap adapters while connected:
https://community.openvpn.net/openvpn/ticket/430
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-2-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9165
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-3-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9167
Signed-off-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r-- | src/openvpn/forward.c | 9 | ||||
-rw-r--r-- | src/openvpn/tun.h | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 39f66e3..27b775f 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -948,6 +948,15 @@ read_incoming_tun (struct context *c) return; } + /* Was TUN/TAP I/O operation aborted? */ + if (tuntap_abort(c->c2.buf.len)) + { + register_signal(c, SIGTERM, "tun-abort"); + msg(M_FATAL, "TUN/TAP I/O operation aborted, exiting"); + perf_pop(); + return; + } + /* Check the status return from read() */ check_status (c->c2.buf.len, "read from TUN/TAP", NULL, c->c1.tuntap); diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index 631b53c..79e2d18 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -391,6 +391,19 @@ tuntap_stop (int status) return false; } +static inline bool +tuntap_abort(int status) +{ + /* + * Typically generated when driver is halted. + */ + if (status < 0) + { + return openvpn_errno() == ERROR_OPERATION_ABORTED; + } + return false; +} + static inline int tun_write_win32 (struct tuntap *tt, struct buffer *buf) { @@ -432,6 +445,12 @@ tuntap_stop (int status) return false; } +static inline bool +tuntap_abort(int status) +{ + return false; +} + static inline void tun_standby_init (struct tuntap *tt) { |