int dev = dev_type_enum(options->dev, options->dev_type);
int metric = 0;
+ /* if DCO is enabled we have both regular routes and iroutes in the system
+ * routing table, and normal routes must have a higher metric for that to
+ * work so that iroutes are always matched first
+ */
+ if (dco_enabled(options))
+ {
+ metric = DCO_DEFAULT_METRIC;
+ }
+
if (dev == DEV_TYPE_TUN && (options->topology == TOP_NET30 || options->topology == TOP_P2P))
{
gw = options->ifconfig_remote_netmask;
const char *gw = NULL;
int metric = -1; /* no metric set */
+ /* see explanation in do_init_route_list() */
+ if (dco_enabled(options))
+ {
+ metric = DCO_DEFAULT_METRIC;
+ }
+
gw = options->ifconfig_ipv6_remote; /* default GW = remote end */
if (options->route_ipv6_default_gateway)
{