aboutsummaryrefslogtreecommitdiff
path: root/tun.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-07-28 11:22:51 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-07-28 11:22:51 +0200
commit328500c490c36c679e275dbf99c2820f58bcbaa3 (patch)
tree8e4fb0f8504c28d8d27aaa24618895bf09d6a439 /tun.c
parentSolved hidden merge conflict between feat_misc and bugfix2.1 (diff)
parentAdded "net stop dnscache" and "net start dnscache" in front (diff)
downloadopenvpn-328500c490c36c679e275dbf99c2820f58bcbaa3.tar.xz
Merge branch 'svn-BETA21' into beta2.2
Conflicts: openvpn.8 - Enhancements to the --register-dns description ssl.h - Community changed n_packets and n_bytes to use counter_type instead of int to avoid integer overflows (commit 6484c6299cf298107316e6497) Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'tun.c')
-rw-r--r--tun.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tun.c b/tun.c
index 07e4c4e..91fff0b 100644
--- a/tun.c
+++ b/tun.c
@@ -3379,17 +3379,37 @@ ipconfig_register_dns (const struct env_set *es)
const char err[] = "ERROR: Windows ipconfig command failed";
netcmd_semaphore_lock ();
+
argv_init (&argv);
+
+ argv_printf (&argv, "%s%sc stop dnscache",
+ get_win_sys_path(),
+ WIN_NET_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
+ argv_printf (&argv, "%s%sc start dnscache",
+ get_win_sys_path(),
+ WIN_NET_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
argv_printf (&argv, "%s%sc /flushdns",
get_win_sys_path(),
WIN_IPCONFIG_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
status = openvpn_execve_check (&argv, es, 0, err);
argv_reset(&argv);
+
argv_printf (&argv, "%s%sc /registerdns",
get_win_sys_path(),
WIN_IPCONFIG_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
status = openvpn_execve_check (&argv, es, 0, err);
argv_reset(&argv);
+
netcmd_semaphore_release ();
}