]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
svn merge -r 760:764 $SO/trunk/openvpn
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Thu, 3 Nov 2005 01:43:43 +0000 (01:43 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Thu, 3 Nov 2005 01:43:43 +0000 (01:43 +0000)
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@766 e7ae566f-a301-0410-adde-c780ea21d3b5

ChangeLog
openvpn.8
route.c

index 4dda4469d7a0772078f8a98ca1f0164ef0d1921f..f7639199d2b04706d1464594191111574572e5c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ $Id$
 
 2005.11.xx -- Version 2.1-beta7
 
+* Fixed bug in Linux get_default_gateway function
+  introduced in 2.0.4, which would cause redirect-gateway
+  on Linux clients to fail.
 * Moved easy-rsa 2.0 scripts to easy-rsa/2.0 to
   be compatible with 2.0.x distribution.
 
index 29df0da0dad4c9b7a2d3fa7747d83a75986b436d..78c6007ef8d30abb2985f2def51075dc94684859 100644 (file)
--- a/openvpn.8
+++ b/openvpn.8
@@ -2949,7 +2949,21 @@ of OpenVPN's client mode.  This directive is equivalent to:
 This option must be used on a client which is connecting
 to a multi-client server.  It indicates to OpenVPN that it
 should accept options pushed by the server, provided they
-are part of the legal set of pushable options.
+are part of the legal set of pushable options (note that the
+.B --pull
+option is implied by
+.B --client
+).
+
+In particular,
+.B --pull
+allows the server to push routes to the client, so you should
+not use
+.B --pull
+or
+.B --client
+in situations where you don't trust the server to have control
+over the client's routing table.
 .\"*********************************************************
 .TP
 .B --auth-user-pass [up]
diff --git a/route.c b/route.c
index cb21489e9cb9bbb429264f758ec3e753c87ad7f6..1db0b36c5c70eb1d7dd483f34c42f5c8d0dd7246 100644 (file)
--- a/route.c
+++ b/route.c
@@ -347,6 +347,10 @@ init_route_list (struct route_list *rl,
       setenv_route_addr (es, "net_gateway", rl->spec.net_gateway, -1);
       dmsg (D_ROUTE_DEBUG, "ROUTE DEBUG: default_gateway=%s", print_in_addr_t (rl->spec.net_gateway, 0, &gc));
     }
+  else
+    {
+      dmsg (D_ROUTE_DEBUG, "ROUTE DEBUG: default_gateway=UNDEF");
+    }
 
   if (rl->flags & RG_ENABLE)
     {
@@ -1342,9 +1346,10 @@ show_routes (int msglev)
 #elif defined(TARGET_LINUX)
 
 static bool
-get_default_gateway (in_addr_t *ret)
+get_default_gateway (in_addr_t *gateway)
 {
   struct gc_arena gc = gc_new ();
+  bool ret = false;
   FILE *fp = fopen ("/proc/net/route", "r");
   if (fp)
     {
@@ -1392,7 +1397,10 @@ get_default_gateway (in_addr_t *ret)
       fclose (fp);
 
       if (best_gw)
-       *ret = best_gw;
+       {
+         *gateway = best_gw;
+         ret = true;
+       }
 
       dmsg (D_ROUTE_DEBUG, "GDG: best=%s[%d] lm=%u",
            print_in_addr_t ((in_addr_t) best_gw, 0, &gc),
@@ -1401,7 +1409,7 @@ get_default_gateway (in_addr_t *ret)
     }
 
   gc_free (&gc);
-  return false;
+  return ret;
 }
 
 #elif defined(TARGET_FREEBSD)