aboutsummaryrefslogtreecommitdiff
path: root/route.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-03 01:43:43 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-03 01:43:43 +0000
commit03653f422fa6f9ff48b3f78c420510f12549f6d8 (patch)
treea537d4ce8ff850ed8de4d59cbf7783fb2c811a22 /route.c
parentChangeLog edit (diff)
downloadopenvpn-03653f422fa6f9ff48b3f78c420510f12549f6d8.tar.xz
svn merge -r 760:764 $SO/trunk/openvpn
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@766 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--route.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/route.c b/route.c
index cb21489..1db0b36 100644
--- 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)