summaryrefslogtreecommitdiffstats
path: root/tun.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2011-03-27 09:20:13 +0000
committerDavid Sommerseth <dazo@users.sourceforge.net>2011-04-26 22:29:11 +0200
commite9f8696f3981fc493501082d996340c9021919c7 (patch)
tree5a7678b4ed04d1a0fbbaa1ddac119b378c61757d /tun.c
parent0db046f253e86a3dd7583e2f7a13b21e7eba7493 (diff)
downloadopenvpn-e9f8696f3981fc493501082d996340c9021919c7.tar.gz
openvpn-e9f8696f3981fc493501082d996340c9021919c7.tar.xz
openvpn-e9f8696f3981fc493501082d996340c9021919c7.zip
Added ./configure --enable-osxipconfig option for Mac OS X which will
enable the use of ipconfig (instead of ifconfig) for configuring the IP address and netmask of the tun/tap adapter. Version 2.1.3p git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@7092 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'tun.c')
-rw-r--r--tun.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tun.c b/tun.c
index 11c4204..8c94f89 100644
--- a/tun.c
+++ b/tun.c
@@ -786,7 +786,24 @@ do_ifconfig (struct tuntap *tt,
tt->did_ifconfig = true;
#elif defined(TARGET_DARWIN)
-
+#ifdef DARWIN_USE_IPCONFIG
+ if (tun)
+ {
+ msg (M_FATAL, "Error: tun point-to-point mode not supported on Darwin when DARWIN_USE_IPCONFIG is defined");
+ }
+ else
+ {
+ argv_printf (&argv,
+ "/usr/sbin/ipconfig set %s MANUAL %s %s",
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask
+ );
+ }
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Mac OS X ipconfig failed");
+ tt->did_ifconfig = true;
+#else
/*
* Darwin (i.e. Mac OS X) seems to exhibit similar behaviour to OpenBSD...
*/
@@ -832,9 +849,11 @@ do_ifconfig (struct tuntap *tt,
tun_mtu
);
}
+
argv_msg (M_INFO, &argv);
openvpn_execve_check (&argv, es, S_FATAL, "Mac OS X ifconfig failed");
tt->did_ifconfig = true;
+#endif
/* Add a network route for the local tun interface */
if (!tun && tt->topology == TOP_SUBNET)