]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Added ./configure --enable-osxipconfig option for Mac OS X which will
authorJames Yonan <james@openvpn.net>
Sun, 27 Mar 2011 09:20:13 +0000 (09:20 +0000)
committerJames Yonan <james@openvpn.net>
Sun, 27 Mar 2011 09:20:13 +0000 (09:20 +0000)
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

configure.ac
tun.c
version.m4

index 729ce40fa2a489de0ad5717d26ec354a8db9e613..342074f9a9ab40cb58560d019acc438963630ecf 100644 (file)
@@ -176,6 +176,11 @@ AC_ARG_ENABLE(iproute2,
    test $enableval = "yes" && AC_DEFINE(CONFIG_FEATURE_IPROUTE, 1, [enable iproute2 support])   
 )
 
+AC_ARG_ENABLE(osxipconfig,
+   [  --enable-osxipconfig    Enable support for ipconfig on OS X],
+   test $enableval = "yes" && AC_DEFINE(DARWIN_USE_IPCONFIG, 1, [Enable support for ipconfig on OS X])
+)
+
 AC_ARG_ENABLE(def-auth,
    [  --disable-def-auth      Disable deferred authentication],
    [DEF_AUTH="$enableval"],
diff --git a/tun.c b/tun.c
index 11c420425353fde6df32e1e8582074d18bd9b646..8c94f89cf1addd1c5cef1d0b67d44e0ba06fc60b 100644 (file)
--- 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)
index cd7ba5657c81cfcaa919c63e1aaa66ee16500626..f8b3b8da15f8a4ae34146aa5c2cf7b53a16bc7ae 100644 (file)
@@ -1,5 +1,5 @@
 dnl define the OpenVPN version
-define(PRODUCT_VERSION,[2.1.3o])
+define(PRODUCT_VERSION,[2.1.3p])
 dnl define the TAP version
 define(PRODUCT_TAP_ID,[tap0901])
 define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])