aboutsummaryrefslogtreecommitdiff
path: root/route.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 20:40:39 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 20:40:39 +0000
commit40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6 (patch)
treefb5ea6dc09883fcbc031da30ce5544ddd9a41822 /route.c
parentVersion number increment. (diff)
downloadopenvpn-40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6.tar.xz
Added --route-metric option to set a default route metric
for --route (Roy Marples). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1011 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'route.c')
-rw-r--r--route.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/route.c b/route.c
index 0b9a78e..b041b3e 100644
--- a/route.c
+++ b/route.c
@@ -276,10 +276,10 @@ init_route (struct route *r,
}
r->metric_defined = true;
}
- else
+ else if (spec->default_metric_defined)
{
- r->metric = 0;
- r->metric_defined = false;
+ r->metric = spec->default_metric;
+ r->metric_defined = true;
}
r->defined = true;
@@ -322,6 +322,7 @@ bool
init_route_list (struct route_list *rl,
const struct route_option_list *opt,
const char *remote_endpoint,
+ int default_metric,
in_addr_t remote_host,
struct env_set *es)
{
@@ -338,6 +339,12 @@ init_route_list (struct route_list *rl,
rl->spec.remote_host_defined = true;
}
+ if (default_metric)
+ {
+ rl->spec.default_metric = default_metric;
+ rl->spec.default_metric_defined = true;
+ }
+
rl->spec.net_gateway_defined = get_default_gateway (&rl->spec.net_gateway);
if (rl->spec.net_gateway_defined)
{