Commit 71c2dfa0 authored by Jussi Laakkonen's avatar Jussi Laakkonen

Cleanup of unreached code related to non-default route setting.

Removed if's that are not reached because service sorting now guarantees
that non-default route VPN cannot be the default service (the first in
the service list).
parent 63d17db1
......@@ -422,12 +422,6 @@ static void set_default_gateway(struct gateway_data *data,
int index;
int status4 = 0, status6 = 0;
bool do_ipv4 = false, do_ipv6 = false;
if (data && !__connman_service_is_default_route(data->service)) {
DBG("Not setting default gateway for %s",
__connman_service_get_ident(data->service));
return;
}
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
do_ipv4 = true;
......@@ -1004,23 +998,6 @@ bool __connman_connection_update_gateway(void)
default_gateway = find_default_gateway();
DBG("default %p", default_gateway);
if (default_gateway &&
!__connman_service_is_default_route(default_gateway->service)) {
DBG("Not updating gateway with non default route %s",
default_gateway->service ?
__connman_service_get_ident(default_gateway->service) :
"");
if (default_gateway->ipv4_gateway)
unset_default_gateway(default_gateway,
CONNMAN_IPCONFIG_TYPE_IPV4);
if (default_gateway->ipv6_gateway)
unset_default_gateway(default_gateway,
CONNMAN_IPCONFIG_TYPE_IPV6);
return true;
}
/*
* There can be multiple active gateways so we need to
......
......@@ -2117,38 +2117,6 @@ static void default_changed(void)
current_default ? current_default->identifier : "");
DBG("new default %p %s", service, service ? service->identifier : "");
/*
* This may not be reached since service that is not default route (VPN)
* should not be on top of service_list. TODO: remove if not reached.
*/
if (!__connman_service_is_default_route(service)) {
/*
* If the current_default is not connected and the new service
* is not the default route, find the next connected from
* services list and use that service as new default
*/
if (current_default && !is_connected(current_default)) {
service = get_connected_default_route_service();
if (service == current_default) {
DBG("Selected new default == current_default");
return;
}
DBG("Selected new default service %s",
service ? service->identifier : "");
} else {
DBG("Not setting %s as default service",
service ? service->identifier : "");
switch_services(service, current_default);
__connman_notifier_default_changed(current_default);
return;
}
}
/*
* If the change over default service is not allowed change the order
* of the service in the service list in a way that current default
......@@ -5903,19 +5871,6 @@ static void switch_default_service(struct connman_service *default_service,
{
struct connman_service *service;
GList *src, *dst;
/*
* If the service to be used as downgrade service is not set as default
* route revert the order of the services.
*/
if (!__connman_service_is_default_route(downgrade_service)) {
DBG("Not switching non default route downgrade service "
"default_service=%s downgrade_service=%s",
default_service ? default_service->identifier : "",
downgrade_service ? downgrade_service->identifier : "");
switch_default_service(downgrade_service, default_service);
return;
}
apply_relevant_default_downgrade(default_service);
src = g_list_find(service_list, downgrade_service);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment