From 8b03c9659ff176fa816c8a42d96b986ec0ff17bd Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 16 Dec 2012 10:39:29 +0100 Subject: Fix parsing of tcp6 and udp6. Also parse connect-retry(-max). (Closes issue #69) --- src/de/blinkt/openvpn/ConfigParser.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java index 1098058f..826f3b62 100644 --- a/src/de/blinkt/openvpn/ConfigParser.java +++ b/src/de/blinkt/openvpn/ConfigParser.java @@ -353,10 +353,12 @@ public class ConfigParser { Vector proto = getOption("proto", 1,1); if(proto!=null){ - if(proto.get(1).equals("udp")) + if(proto.get(1).equals("udp") || proto.get(1).equals("udp6")) np.mUseUdp=true; else if (proto.get(1).equals("tcp-client") || - proto.get(1).equals("tcp")) + proto.get(1).equals("tcp") || + proto.get(1).equals("tcp6") || + proto.get(1).endsWith("tcp6-client")) np.mUseUdp=false; else throw new ConfigParseError("Unsupported option to --proto " + proto.get(1)); @@ -439,6 +441,15 @@ public class ConfigParser { if(getOption("persist-tun", 0,0) != null) np.mPersistTun=true; + Vector connectretry = getOption("connect-retry", 1, 1); + if(connectretry!=null) + np.mConnectRetry =connectretry.get(1); + + Vector connectretrymax = getOption("connect-retry-max", 1, 1); + if(connectretrymax!=null) + np.mConnectRetryMax =connectretrymax.get(1); + + Vector authuser = getOption("auth-user-pass",0,1); if(authuser !=null){ -- cgit v1.2.3