From b7b4e00536107c951a2642a2a1a3fe21a65510a0 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 3 May 2012 22:20:26 +0200 Subject: Error message if tun cannot be opened --- .hgignore | 7 +++++++ openvpn/src/compat/compat-stdbool.h | 12 ++++++++++++ openvpn/src/openvpn/tun.c | 4 +++- res/menu/vpn_context.xml | 20 ++++++++++++++++++++ res/values/strings.xml | 9 +++++++-- 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 openvpn/src/compat/compat-stdbool.h create mode 100644 res/menu/vpn_context.xml diff --git a/.hgignore b/.hgignore index 05898e3f..51dc327b 100644 --- a/.hgignore +++ b/.hgignore @@ -2,5 +2,12 @@ obj bin libs gen +openvpn/.git +openvpn/autom4te.cache +openvpn/aclocal.m4 +openvpn/config.log +openvpn/config.h.in +openvpn/configure +open syntax: regexp ^openvpn/xcopenvpn$ \ No newline at end of file diff --git a/openvpn/src/compat/compat-stdbool.h b/openvpn/src/compat/compat-stdbool.h new file mode 100644 index 00000000..99412188 --- /dev/null +++ b/openvpn/src/compat/compat-stdbool.h @@ -0,0 +1,12 @@ +#ifndef __COMPAT_STDBOOL_H +#define __COMPAT_STDBOOL_H + +#ifdef HAVE_STDBOOL_H +#include +#else +typedef int bool; +#define false 0 +#define true 1 +#endif + +#endif diff --git a/openvpn/src/openvpn/tun.c b/openvpn/src/openvpn/tun.c index 7aa8627d..14ec2b85 100644 --- a/openvpn/src/openvpn/tun.c +++ b/openvpn/src/openvpn/tun.c @@ -1386,7 +1386,9 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tu if(tt->options.domain) android_set_domain(tt->options.domain); - tt->fd = android_open_tun(); + if((tt->fd = android_open_tun()< 0){ + msg (M_ERR, "ERROR: Cannot open TUN"); + } } #else diff --git a/res/menu/vpn_context.xml b/res/menu/vpn_context.xml new file mode 100644 index 00000000..ab681379 --- /dev/null +++ b/res/menu/vpn_context.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index c8e2b1e1..5434f48b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -21,7 +21,7 @@ Server Address: Server Port: Shared Secret: - Connect! + Connect OpenVPN is connecting… OpenVPN is connected! @@ -113,9 +113,14 @@ Specify custom options. Use with care! Route rejected by Android Cannot make sense of %s and %s as IP and CIDR netmask, assuming P2P for local address (/32) - cancel + Disconnect clear log Cancel Confirmation Disconnect the connected VPN/cancel the connection attempt? Remove VPN + Edit VPN Settings + Remove the VPN Profile %s? + " On some custom ICS images the permission on /dev/tun might be wrong, or the tun module might be missing completly" + Opening tun interface failed badly. + "Error: " -- cgit v1.2.3